The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> IIS
|
Custom 404 Errors - Persisting original page's query string
Discuss Custom 404 Errors - Persisting original page's query string in the IIS forum on Dev Shed. Custom 404 Errors - Persisting original page's query string IIS forum discussing Microsoft's Internet Information Server including its configuration, optimization and other related topics. IIS is the most popular web server for the Windows platform.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 26th, 2005, 10:08 AM
|
|
Contributing User
|
|
Join Date: Feb 2005
Posts: 77
Time spent in forums: 10 h 33 m 6 sec
Reputation Power: 9
|
|
|
Custom 404 Errors - Persisting original page's query string
Hey all,
On my local setup of IIS, I have a single application's Custom Errors set so 404's go to an aspx page. When the 404 kicks in, the URL in the browser stays the same as the non-existant URL, and the 404 page shows. I am able to get the query string of the non-existant requested URL, and use it to find related pages.
Now, when I bring this live, I have the entire website's Custom Error 404 set. When the 404 kicks in, it redirects to the 404 page with query string "404;http://blahblah.com/page.ext", cutting off the original URL's query string. This kills my ability to offer related pages based on the query string.
Does anyone know how I can fix this? Works perfect locally, doesn't work remotely. Thanks in advance!
|

October 26th, 2005, 11:51 AM
|
|
Registered User
|
|
Join Date: Oct 2005
Location: Karachi
Posts: 6
  
Time spent in forums: 1 h 7 m 3 sec
Reputation Power: 0
|
|
|
Are you and your host using same version of IIS?
|

October 26th, 2005, 01:28 PM
|
|
Contributing User
|
|
Join Date: Feb 2005
Posts: 77
Time spent in forums: 10 h 33 m 6 sec
Reputation Power: 9
|
|
Quote: | Originally Posted by chuck59 Are you and your host using same version of IIS? |
Good question. My local version is 5.1, the remote IIS app is setup slightly different (no About menu item) - the help file says 5.0.
|

October 28th, 2005, 12:18 AM
|
|
|
|
Have you asked your host about this?
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi
|

October 28th, 2005, 07:45 AM
|
|
Contributing User
|
|
Join Date: Feb 2005
Posts: 77
Time spent in forums: 10 h 33 m 6 sec
Reputation Power: 9
|
|
|
We host or own. I would think that if the query string were attached, it would either hide the new URL (301 redirect, I think?) or convert the original URL to be URLEncoded so the "?" wouldn't appear twice. Also, HTTP_REFERER does not give the original URL. This is driving us crazy, please help!
|

November 3rd, 2005, 06:53 AM
|
|
Contributing User
|
|
Join Date: Feb 2005
Posts: 77
Time spent in forums: 10 h 33 m 6 sec
Reputation Power: 9
|
|
|
Still unable to find a solution to this... I read about a user on another forum with the same problem, and they concluded that it was not possible, but I fail to believe that!
|

November 3rd, 2005, 12:21 PM
|
|
|
|

November 10th, 2005, 07:05 AM
|
|
Contributing User
|
|
Join Date: Feb 2005
Posts: 77
Time spent in forums: 10 h 33 m 6 sec
Reputation Power: 9
|
|
Quote: | Originally Posted by Doug G |
Thanks Doug, from going to iisfaq.com I found out that this "problem" is more of a "feature" that has to be specified per file extension. The main file extension I was using as ASP, and that apparently has it's own 404 handling, so turning it on in IIS for .ASP files solved the problem. Thanks!
|

November 10th, 2005, 07:00 PM
|
|
|
|
Hey, I'm glad you got it sorted out!
|

November 11th, 2010, 05:02 AM
|
|
Registered User
|
|
Join Date: Nov 2010
Posts: 1
Time spent in forums: 25 m
Reputation Power: 0
|
|
|
Sorry to reopen a long-dead thread, but I have the exact (well, almost) issue as dizzle.
I'm using IIS6 and ASP for my website and virtually every single page is served by one asp file. The website is working fine except when it comes to passing queries in the URL.
When I use ASP's Request.QueryString("varname") method, I can't seem to get the first variable - but the subsequent variables are fine. I am guessing the problem is because there is a "404;" string in front of the original query due to the fact that every page is essentially the same asp file.
So my guess would be that ASP's method overlooks the second ? as it already sees the first question mark before 404.
From dizzle's post, it seems that he figured out how to fix this. Anyone (or dizzle if you're still getting emails from this site) knows if there is a way to tell IIS so that it wouldn't attach that ?404;http://originalURL as a query string?
Thanks!
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|