• Home /
  • Blog /
  • How to create a custom 404 page in Umbraco 8
How To Create 404 Page In Umbraco

How to create a custom 404 page in Umbraco 8

When you develop a new website using Umbraco, you may notice that the 404 page is intentionally left ugly and you need to make sure it does have some lovely template.

Default Umbraco 404 page is intentionally left ugly

It is possible and straightforward to create a great 404 page in Umbraco using just Umbraco CMS. It means that you do not need any web.config changes like you usually do in ASP.NET MVC application, Umbraco already has a build in support for 404 error page.

To create a 404 page for your Umbraco website you need to create a new document type (in fact you may use existing document type but point it to the different template).

Create a new document type to have a custom 404 page in Umbraco

Next, you need to update 404 template and add all required styles and content there.

Update 404 page template and include styles to make it user friendly

After the template is ready, you need to Create a 404 content page and make sure it is not visible in the navigation.

Create a new 404 content page in Umbraco

After you saved the page, you are going to get a page ID, which you can find either in URL or on Info tab like on the screenshot below.

Where to find Umbraco Page ID

With that ID, you need to open UmbracoSettings.Config file and update <error404> tag with the ID of your page.

Update UmbracoSettings.Config file with the new 404 page ID

As you see from the documentation, you can assign different 404 pages for different languages

Now if you try to access any page which does not exist you are going to get a friendly 404 page which using your template

User friendly 404 error page in Umbraco

Also, Umbraco also taking care of response code which browser get back, it is a correct 404 Page not found code, so you should not have issues with search engines.

Umbraco returns correct 404 code to browser

Comments

Yaplex - Freelance developer - white logo on black background

Yaplex is an IT Consulting and .NET development company co-founded by .NET Software developer Alex Shapovalov who lives in Canada and provides software development services in Canada, USA and all over the world.

Contact Information

Toronto, Canada
Phone: +1 647 328 3809
Email: alex@yaplex.com