Copied to clipboard

Flag this post as spam?

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


  • Ben John Bagley 16 posts 146 karma points
    Oct 15, 2018 @ 00:01
    Ben John Bagley
    0

    So I've been looking for a solution but haven't found anything concrete.

    I have a 404 page HTML page that I want as my 404 and for any other errors, 500, 404 etc.

    Is there a way to get this page to render on errors? I have looked in the config files for custom errors but I can't see any rules for the pages.

    Also is there a way to do this dynamically? So have one template for all errors and set the status code based on the error.

    I.e. A 500 error will display 500 etc.

  • Kieron 152 posts 390 karma points
    Oct 15, 2018 @ 09:31
    Kieron
    0

    For the 404, I tend to just add to the <errors> block in umbracoSettings.config Like so;

    <errors>
          <error404>1431</error404>
    </errors>
    

    Sometimes (IIS 7.5+) this can need the extra line below adding to the web.config

    <system.webServer>
         <httpErrors existingResponse="PassThrough"/>
    </system.webServer>
    

    But I dont think you can just add more errors above, especially 500, you'd probably need to set that using the web.config again. Try: <customErrors mode="On" defaultRedirect="~/error.aspx"> where error.aspx is your (ideally static) 500 page.

Please Sign in or register to post replies

Write your reply to:

Draft