Posted By

thesmu on 05/09/13



Versions (?)

Configuring 404 pages -

 / Published in: ASP


Configuring 404 pages -

  1. Out of the box, umbraco displays a standard 404 message, which does not make much sense to your end-users. it is therefore important that you change that page.
  3. A 404 page can be any page in your umbraco installation and umbraco will simply render that page instead of the missing page, it will not redirect to another Url, so urls will stay the same, but the content rendered will be different
  5. Set a standard 404 page
  7. Open the configuration file /config/umbracosettings.config and look for the element <errors> which by default will look like this:
  10. <errors>
  11. <!-- the id of the page that should be shown if the page is not found -->
  12. <!-- <errorPage culture="default">1</errorPage>-->
  13. <!-- <errorPage culture="en-US">200</errorPage>-->
  14. <error404>1826</error404>
  15. </errors>
  16. The <error404> element contains a number, this number is the node ID of the page you would like to render instead of the missing page. Simply find the page in the umbraco content section, look on the properties tab for ID, and insert it in the configuration file.
  18. Set a culture dependant error page
  20. For umbraco installations running multiple sites, it is not enough to just have a single error page, as that would mix the languages and sites when users cannot find a page. the <errors> element therefor also contain the option to add a <errorPage culture="en-US"> element, also containing a node ID.
  22. By specifying the culture on the <errorPage> element you tell umbraco what page to render, in case a page is not found, and the culture is equal to the culture ID. The culture ID is set as part of configuring hostnames on your content.

Report this snippet  

You need to login to post a comment.