Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS 5.0 + 404 error page problem

Status
Not open for further replies.

worldwise

Programmer
Jun 1, 2005
112
US
Hi,

I'm running into this problem in my 404 redirect page. This problem is specific to IIS 5.0 (or whatever comes with Windows 2000). The same page works fine in IIS 6.0.

If a user goes to and gets redirected, I can't find a way to access what the querystring paramater/value was (i.e. that c = xx).

I've tried:
Request.ServerVariables("HTTP_URL")
Request.ServerVariables("QUERY_STRING")
Request.ServerVariables("URL")
Request.ServerVariables("HTTP_REFERER")

I need to know the querystring values so I can redirect to the correct page with those querysting values.

Thanks in advance.

-Kevin
 

the querystring sent to a 404 page is the failed URI with 404; prepended .

You need to split() the request.servervariables("query_string") at the "?" and the upper bound value of the array will be all of the query string keys and values.

with only one key/value pair, split this value at the "=" and the lower bound will have the key and the upper bound will have the value.



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Interesting. I'm testing on Windows 2000 IIS 5.0. Do you know what setting I can change to fix this so the querystring parameters are properly forwarded over?
 
Can't think of anything that may cause the problem, having never come across it and I use the 404 error page on several sites on three different servers for URL rewriting / decoding / redirecting

is your custom 404 set to URL on both servers?

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Here is the answer. From IIS enable the "Check that file exists" option for asp pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top