Skip to main content
Sitemap

404 page not found

Inform users when a page was not found

When someone visits a page that does not exist on your site, most static website hosts will show a custom 404 error page if you provide one in a certain location, such as 404.html at the top level of your site.

This plugin creates a 404 page that can help users understand what happened and how to find what they need.

View an example 404 page (opens in a tab)

By default the 404 page tells users:

If you typed the web address, check it is correct.

If you pasted the web address, check you copied the entire address.

You can browse from the homepage or use the sitemap to find the information you need.

Configure the 404 page

The plugin enables the 404 page by default. To turn it off, set templates.error404: false in your plugin options.

Or, you can customise the page by using these options:

Template options
Name Type Description
title string

Sets the page title (default is 'Page not found').

content string

Sets the page content using Markdown (default content shown above.)

permalink string

Sets the file name and location (default is '/404.html'). Set to false to disable writing this file to the output folder.

Change how the 404 page looks

The 404 page uses the error layout. You can edit this layout to change how the page appears.

Replace the 404 page

You can create your own 404 page that replaces this one. To do this, create a page that saves to the same location (by default /404.html).

When you do this, your page will be used instead of the plugin’s default.