Configuring 404 pages - our.umbraco.org


/ Published in: ASP
Save to your folder(s)

Configuring 404 pages - our.umbraco.org


Copy this code and paste it in your HTML
  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.
  2.  
  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
  4.  
  5. Set a standard 404 page
  6.  
  7. Open the configuration file /config/umbracosettings.config and look for the element <errors> which by default will look like this:
  8.  
  9.  
  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.
  17.  
  18. Set a culture dependant error page
  19.  
  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.
  21.  
  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.

URL: http://our.umbraco.org/wiki/install-and-setup/configuring-404-pages#

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.