« Previous Next »

Thread: httpErrors not working in Vista

Last post 10-20-2009 12:44 PM by Robba. 9 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (10 items)

Sort Posts:

  • 02-04-2009, 2:29 PM

    • Robba
    • Top 75 Contributor
    • Joined on 03-16-2007, 11:18 AM
    • Dallas, Tx
    • Posts 101

    httpErrors not working in Vista

    I have the http error pages module pointing to custom error pages.  Example the 404 error points to "/errors/404.htm".

    I have tried setting this at site level, with <section name="httpErrors" overrideModeDefault="Allow" />

    I have tried setting it at the server level and I have tried placing 

     <location path="test">
        <system.webServer>
          <httpErrors>
            <remove statusCode="500" subStatusCode="-1" />
            <remove statusCode="404" subStatusCode="-1" />
            <remove statusCode="403" subStatusCode="-1" />
            <remove statusCode="401" subStatusCode="-1" />
            <error statusCode="401" prefixLanguageFilePath="" path="/errors/401.aspx" responseMode="ExecuteURL" />
            <error statusCode="403" prefixLanguageFilePath="" path="/errors/403.aspx" responseMode="ExecuteURL" />
            <error statusCode="404" prefixLanguageFilePath="" path="/errors/404.aspx" responseMode="ExecuteURL" />
            <error statusCode="500" prefixLanguageFilePath="" path="/errors/500.aspx" responseMode="ExecuteURL" />
          </httpErrors>
        </system.webServer>
      </location>

    in the applicationHost.config file.

    None of these causes my workstation to redirect to the 404.htm page.  When I enter a bad URL I only get the default, built in 404 page.

     

    Ideas as to why this isn't working in Vista (I can take the same site and run it on Server 2008 and it works)?  What can I do to make it work?

    Thanks,
    Robba
    http://robbaugh.com/
  • 02-04-2009, 3:25 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: httpErrors not working in Vista

    What is the request URL and what is custom error you are getting? Also can you paste the httpErrrors configuration as seen for the request? You can use "appcmd list config http://<url> /section:httpErrors.

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 02-04-2009, 3:51 PM In reply to

    • Robba
    • Top 75 Contributor
    • Joined on 03-16-2007, 11:18 AM
    • Dallas, Tx
    • Posts 101

    Re: httpErrors not working in Vista

    The request URL is http://test/sdf.htm (mapped in hosts file).  I get the default IIS 404 page.  The httpErrors config is this:

     <system.webServer>
      <httpErrors>
        <error statusCode="401" prefixLanguageFilePath="" path="/errors/401.aspx" responseMode="ExecuteURL" />
        <error statusCode="403" prefixLanguageFilePath="" path="/errors/403.aspx" responseMode="ExecuteURL" />
        <error statusCode="404" prefixLanguageFilePath="" path="/errors/404.htm" responseMode="ExecuteURL" />
        <error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />

        <error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />

        <error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />

        <error statusCode="500" prefixLanguageFilePath="" path="/errors/500.aspx" responseMode="ExecuteURL" />
        <error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />

        <error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />

      </httpErrors>
    </system.webServer>

    Thanks,
    Robba
    http://robbaugh.com/
  • 02-05-2009, 5:14 PM In reply to

    • Robba
    • Top 75 Contributor
    • Joined on 03-16-2007, 11:18 AM
    • Dallas, Tx
    • Posts 101

    Re: httpErrors not working in Vista

    Bump...

    Can anyone confirm that custom http error URLs work on Vista?

    Thanks,
    Robba
    http://robbaugh.com/
  • 02-06-2009, 2:03 AM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: httpErrors not working in Vista

    Yes, custom errors does work in Vista. Can you pls paste the default custom error you got? I wonder if you are seeing the detailed error message you get when you send the request from local machine. Also you might see a generic error if ExecuteURL for /errors/404.htm fails. Can you verify request to http://test/errors/404.htm return 200?

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 02-06-2009, 10:11 AM In reply to

    • Robba
    • Top 75 Contributor
    • Joined on 03-16-2007, 11:18 AM
    • Dallas, Tx
    • Posts 101

    Re: httpErrors not working in Vista

    Here is the error page I get.  I can confirm that my http://test/errors/404.htm page does work.  I am able to navigate to it manually.

    Internet Information Services 7.0

    Error Summary

    HTTP Error 404.0 - Not Found

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    Detailed Error Information
    ModuleIIS Web Core
    NotificationMapRequestHandler
    HandlerStaticFile
    Error Code0x80070002
    Requested URLhttp://test:80/sdf.htm
    Physical PathC:\WebSites\test\sdf.htm
    Logon MethodAnonymous
    Logon UserAnonymous

     

     

     

    Thanks,
    Robba
    http://robbaugh.com/
  • 02-06-2009, 11:08 AM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: httpErrors not working in Vista

    Hi,

    This is the detailed error you get when you send the request from the localhost. To get the custom error, either send the request from a remote machine or set errorMode="Custom" in httpErrors section properties to turn off detailed errors completely. See this blog post for more details.

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 02-06-2009, 11:50 AM In reply to

    • Robba
    • Top 75 Contributor
    • Joined on 03-16-2007, 11:18 AM
    • Dallas, Tx
    • Posts 101

    Re: httpErrors not working in Vista

    Thanks Kanwal,

     

    That resolved my problem.  This brings up a question of the <customErrors mode>

            <customErrors mode="Off" defaultRedirect="~/errors/404.htm">
                <error statusCode="404" redirect="~/errors/404.htm" />
            </customErrors>

    Is that no longer used? In the past this is where I set whether to use custom errors vs. the default errors.

     

    Thanks,
    Robba
    http://robbaugh.com/
  • 02-06-2009, 5:54 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: httpErrors not working in Vista

    Robba,

    customErrors section is used by asp.net custom errors module and httpErrors section is used by IIS custom errors. With IIS7, there is some overlap between the two modules and is sometimes confusing. customErrors configuration can still work but be aware of IIS custom errors module behavior depending on existingResponse property value. Refer to my blog for more details. If you are configuring custom errors for a new application to run on IIS7, you should be using IIS custom errors.

    Hope this helps.
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 10-20-2009, 12:44 PM In reply to

    • Robba
    • Top 75 Contributor
    • Joined on 03-16-2007, 11:18 AM
    • Dallas, Tx
    • Posts 101

    Re: httpErrors not working in Vista

     test

    Thanks,
    Robba
    http://robbaugh.com/
Page 1 of 1 (10 items)
Microsoft Communities