IIS Retaining QUERYSTRING to Custom 404 Pages

  • 14 years ago

    Hola all,

    I am attempting to set up a custom 404 page which will be able to parse the bad address and send the user to the right page (while telling the search engine what the new page would be)

    this is pretty straight forward at first:
    • I pointed my custom errors to the .asp page which i want it to use, assigning it as a URL rather then a file.
    • i build my .asp page to retrieve the information and get ready to parse it...

    but wait!

    although the address bar still shows: http://www.mydomain.com/page.asp?var=val&var2=val2 when i look at the request.querystring it shows me the bad URL without the querystring!

    req.servervariables("querystring") shows
    /404.asp?404;http://www.mydomain.com/page.asp!!!!

    i've looked all over, and i cannot find a way to get to that lovely address in the address bar complete with querystring and toaster! Can anyone help me?

     I've noticed that this problem only seems to appear with a file with an .asp extention. ie.
    mydomain.com/page.asp?var1=val1 will present me with /404.asp?404;/page.asp
    mydomain.com/page.html?var1=val1 will present me with /page.html?var1=val1 like it should

    strangly, sometimes when i am trying to play with the .asp extention, the address bar in the browser will show me the origonal URL and sometimes it will actually show me the 404.asp page URL.. /EDIT


    -Echo

  • 13 years ago
    Hi there.

    I now this thread is a bit old, but I have a similiar problem with missing .asp pages that show bad address in the address bar. As you had noticed, it only happnes with missing .asp pages and not with missing .htm pages, for example. I am looking for a solution for this for quite a while now and am hopeless. One thing I noticed is that it used to work on a certain hsoting company all right, and it "messed up" when I moved to another hosting company, so I am pretty sure it has something to do with the server configuration (IIS). Only thing is, that I dont know which iis setting will fix that.

    Do you have the solution to this by now by any chance?

    I will appriciate anything you might have to say. Am pretty clueless with this by now.

    Thanks.
    Ami










Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There's no test like production” - Anon