# How to make a custom 404 page

When you visit a URL that doesn't exist or couldn't be found on the server because the webpage was moved or deleted, the broken link redirects to a 404 error page where a message indicating this error is shown.

The default 404 page displays:

> **404 Not Found**

## Creating a Custom 404 Page

If you want to create a customized page for this, you will need to create a new page and change two things:

1. **Change the Status Code** from `200` to `404`
2. **Set the Dynamic Path** to `/*` to catch all non-existent routes

<figure><img src="/files/LQytgEdfiR4WdNthBvGb" alt="Page settings showing Status Code set to 404 and Path set to /*"><figcaption><p>Set the status code to 404 and the path to <code>/*</code></p></figcaption></figure>

After that, you can design the page however you like.

## Redirecting to Homepage Instead

If you do not want to show a 404 page error but always redirect to the homepage, you can set the redirect to `/`.

## Related

* [Project settings](/university/foundations/project-settings.md) – Configure redirects, custom code, and other project-level settings
* [CMS](/university/foundations/cms.md) – Create dynamic pages that won't trigger 404 errors
* [Variables](/university/foundations/variables.md) – Use system variables to customize page behavior


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webstudio.is/university/how-tos/how-to-make-a-custom-404-page.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
