---
title: "Generate a custom static error page"
slug: "generate-a-custom-static-error-page-1188162"
abstract: "Link to custom 404 or 500 error pages in the Content Editor."
---
# Generate a custom static error page

SXA lets you set site-specific 404 and 500 error pages. When an error occurs, visitors are redirected to one of these static error pages.

404 custom error pages are multi-lingual and are, by default, displayed in the context language of the website visitor. If a website visitor requests a page in, for example, Italian, but the page does not exist in Italian, they are redirected to a 404 page in Italian:

- If a 404 page does not exist in the language requested by a website visitor, they are redirected to a 404 page in the default language of the website.
- If a 404 page does not exist in the default language of the website, the website visitor is redirected to the standard Sitecore 404 page.

> [!note]
> -   Because of Next.js limitations, this solution is not supported in a multisite setting when using JSS.
>
> -   For a page not found (404) error page, create the page under your Sitecore instance.
>
> -   For a server error (500) page, [create the page on the website](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/error-pages-in-the-jss-next-js-sample-app.html) of the rendering host. The Server error page link field in the Content Editor is inactive.
>
> -   If you're using JSS version 21 or later with Next.js and you enable the `DISABLE_SSG_FETCH` setting, the JSS app won't fetch 404 or 500 custom error pages.

To generate a static 404 error page:

1. Create your error page.
2. Publish the error page.
3. Navigate to *sitecore/Content/<site collection>/<site>/Settings* .
4. In the **Error Handling** section, in the **Page not found link** field, insert a link to the custom error page.

    ![Insert a link to the error page](https://doc.sitecore.com/api/markdown-image/xp/en/developers/sxa/105/sitecore-experience-accelerator/images/headless-site-error-handling.png)

    > [!note]
    > If you can't find the Error Handling section, you might have forgotten to select the Error Handling option when creating your site collection.