Results 1 to 12 of 12

Thread: web.config customErrors defaultRedirect not always redirecting

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question web.config customErrors defaultRedirect not always redirecting

    PHP Code:
    <customErrors mode="On" defaultRedirect="Error.htm" >
    </
    customErrors
    My site is running in IIS 7 and sometimes after an error is thrown I actually see my error page but other times I get the typical asp.net YSOD. Even though the address to the page is actually showing the same address in the address bar as if the correct error page is actually visible.

    Code:
    http://site/Error.htm?aspxerrorpath=/site/default.aspx
    There is no rhyme or reason to the frequency of this happening. I can restart the web site and it doesn't seem to be affected. Once the correct error page is shown, it will keep being shown for quite a while. Then randomly the YSOD will be shown two to three times until finally the correct one is shown again.

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: web.config customErrors defaultRedirect not always redirecting

    If this is not code related(you override something in code) then maybe it's IIS7 related but the thing is i will be using IIS7 in a month or so and i cannot test something now.
    did you looked here?
    http://stackoverflow.com/questions/2...alt-error-page
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: web.config customErrors defaultRedirect not always redirecting

    Quote Originally Posted by sapator View Post
    If this is not code related(you override something in code) then maybe it's IIS7 related but the thing is i will be using IIS7 in a month or so and i cannot test something now.
    did you looked here?
    http://stackoverflow.com/questions/2...alt-error-page
    In the post that's similar to my problem except it doesn't happen to me all the time. It looks like they never solved the problem so it isn't much help.

  4. #4
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: web.config customErrors defaultRedirect not always redirecting

    try adding a root path to the error page.

    Code:
    defaultRedirect="~/Error.htm" >
    That is if error.htm is in the root of the website.
    The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: web.config customErrors defaultRedirect not always redirecting

    Quote Originally Posted by brin351 View Post
    try adding a root path to the error page.

    Code:
    defaultRedirect="~/Error.htm" >
    That is if error.htm is in the root of the website.
    Resolving it to the root didn't help but I've found how to reproduce the problem. When I change <customErrors mode="On" defaultRedirect="~/Error.htm"> mode to Off or RemoteOnly and throw an error in Application_Start, I see the full detailed asp error page as I would expect. If I change it back to on and refresh the site I get the stripped down asp error page shown in the image below.

    I've done up to 10 or 15 quick refreshes or hit the site in new tabs and I'll finally see the custom error page. It's as if there's a 15 to 20 second lag before the custom error page is shown.


    Attached Images Attached Images  

  6. #6
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: web.config customErrors defaultRedirect not always redirecting

    That is very odd behavour. What version of IIS is the site on and does this happen on your dev machine or just the server.
    The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded.

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: web.config customErrors defaultRedirect not always redirecting

    I have to agree with brin, very strange indeed. Are you able to provide the additional information that was requested?

    Gary

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: web.config customErrors defaultRedirect not always redirecting

    Sorry, I currently have my win7 x64 dev machine setup as an IIS 7.0 server where the site is hosted. I'm not able to test on a remote server at the moment.

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: web.config customErrors defaultRedirect not always redirecting

    What about running up a Virtual Machine, and hosting the site the there?

    Gary

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: web.config customErrors defaultRedirect not always redirecting

    Quote Originally Posted by gep13 View Post
    What about running up a Virtual Machine, and hosting the site the there?

    Gary
    I just setup a VM but it will be just a while before I get IIS and the site setup and tweaked. I'll let you know how it turns out.

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: web.config customErrors defaultRedirect not always redirecting

    Sounds good. Depending on the software you are using, once you have everything setup, make sure you take a snapshot, that way you can rollback to the start if you need to.

    Gary

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: web.config customErrors defaultRedirect not always redirecting

    Quote Originally Posted by gep13 View Post
    Sounds good. Depending on the software you are using, once you have everything setup, make sure you take a snapshot, that way you can rollback to the start if you need to.

    Gary
    I've used a snapshot several times before and saved a lot of hassle but I forgot this time. Thanks for the reminder!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width