Custom Error Pages

Last updated on June 26, 2024.

Instead of returning standard error pages, you can set up custom error pages that match your site's design and include information you would like to convey to your users (e.g. helpful content, relevant links, encouragement to search or browse further).

The following error pages are automatically created when you create an Instance:

  • 401 - Unauthorised
  • 403 - Forbidden
  • 404 - Not Found
  • 500 - Server Error
  • 503 - Maintenance

Error pages are a type of page so you can use all page features (e.g. Layouts). To create a customised error page, create a page and set the file name to the status code similar to the example below:

app/views/pages/404.html.liquid

Important

You may customise existing system pages and create new ones using the Instance Admin. Please visit the Adding Content document for more details.

Error Pages

The types of error pages are displayed in the table below:

Status Code Name Usage
403 Forbidden Only used for an Authorisation Policy violation.
404 Not Found Rendered in multiple scenarios. Most commonly, it is rendered when you try to access or modify an object that does not exist. You can also set an Authorisation Policy's to 404 to force-render this page instead of the default 403.
500 Server Error If there is an error that the system cannot handle gracefully, a server error page is displayed.
503 Maintenance You can enable maintenance mode through the Insites Console (check the attribute).

Other formats

Like any other page, error pages can have various formats responding to different requests. For example, our documentation page will return an error if a page in the json format does not exist.

You can create any error page in any format as long as this format is supported. Please visit the documentation on Pages for more information.

Examples

app/views/pages/404.txt.liquid

app/views/pages/404.xml.liquid

Note that in this case, the or properties in the page definition were omitted because they are both defined inside the file name. You may, however, still include them if you prefer.

Related Topics

Pages

Layouts

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.