Return to Snippet

Revision: 63448
at May 9, 2013 01:43 by thesmu


Initial Code
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.

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

Set a standard 404 page

Open the configuration file /config/umbracosettings.config and look for the element <errors> which by default will look like this:


<errors>
   <!-- the id of the page that should be shown if the page is not found -->
   <!--        <errorPage culture="default">1</errorPage>-->
   <!--        <errorPage culture="en-US">200</errorPage>-->
   <error404>1826</error404>
</errors>
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.

Set a culture dependant error page

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. 

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.

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

Initial Description
Configuring 404 pages - our.umbraco.org

Initial Title
Configuring 404 pages - our.umbraco.org

Initial Tags


Initial Language
ASP