#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    77
    Rep Power
    10

    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!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Location
    Karachi
    Posts
    6
    Rep Power
    0
    Are you and your host using same version of IIS?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    77
    Rep Power
    10
    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.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    Have you asked your host about this?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    77
    Rep Power
    10
    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!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    77
    Rep Power
    10
    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!
  12. #7
  13. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    Sorry I can't offer any help. Perhaps some site like iisfaq.com can help, or some site from this google search

    http://www.google.com/search?q=iis+f...en-US:official
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    77
    Rep Power
    10
    Originally Posted by Doug G
    Sorry I can't offer any help. Perhaps some site like iisfaq.com can help, or some site from this google search

    http://www.google.com/search?q=iis+f...en-US:official
    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!
  16. #9
  17. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    Hey, I'm glad you got it sorted out!
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    1
    Rep 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!

IMN logo majestic logo threadwatch logo seochat tools logo