Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Sep 07, 2012 @ 15:16
    Bjarne Fyrstenborg
    0

    How does Umbraco handle custom 404 error page

    Hi..

    How does Umbraco handle custom 404 error page? .. In umbracoSettings.config you specify the nodeid and culture too if using multiple languages on the node/nodes which the user should see if the user get a 404 error.

    I have setup some Umbraco sites hosted by Surftown and UnoEuro where it is working with the custom error page. Now I have a local Umbraco site running in Webmatrix where the custom error page is working and also in the IIS.

    But when I upload the page to DanDomains server the site is running fine, but it's not showing Umbracos custom 404 error page, but the default asp.net 404 page.

    I talked with their support and told it could be done with have a 404.html page in the root or handle redirect on 404 error in web.config.

    I came by this page: http://weblogs.asp.net/nannettethacker/archive/2012/01/15/custom-error-pages-and-404-page-not-found-error-web-config-setup.aspx

    I my web.config file I added:

    <httpErrors>
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="/1151.aspx" 
        responseMode="ExecuteURL" />
    </httpErrors>

    and

    <customErrors mode="RemoteOnly" defaultRedirect="~/1151.aspx">
        <error statusCode="404" redirect="~/1151.aspx"/>
    </customErrors>

    I seems to work when I then access an page, which not exists and I see the custom 404 page which has node id 1151.

    But then it will probably not be handled from umbracoSettings.config.. 

    Have someone had this issue or experience with this at DanDomain?

    /Bjarne

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Sep 07, 2012 @ 15:24
    Bjarne Fyrstenborg
    0

    After reading this post: http://our.umbraco.org/forum/using/ui-questions/8244-IIS7-404 I found that could just add <httpErrors existingResponse="PassThrough" /> inside <system.webServer> adn then I'll get the custom 404 error page specified in umbracoSettings.config.

    /Bjarne

  • Drew 165 posts 340 karma points
    Sep 07, 2012 @ 15:42
    Drew
    0

    I tend to find that every site we work on needs a custom 404 page (which wouldn't?) so I'm wondering if the PassThrough element should be set as default - therefore a user can simply comment it out of change it if they don't want they behaviour?

     

     

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Sep 10, 2012 @ 08:31
    Bjarne Fyrstenborg
    0

    I think they might have change something that not was default in IIS or perhaps because it's using IIS7, where I have seen some posts related to this.. but it works when adding this line in web.config..

Please Sign in or register to post replies

Write your reply to:

Draft