Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"guides/changelogs",
"guides/hidden-pages",
"settings/broken-links",
"settings/custom-404-page",
"guides/monorepo",
{
"group": "Custom Subdirectory",
Expand Down
41 changes: 41 additions & 0 deletions settings/custom-404-page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "Custom 404 page"
description: "Customize the title and description of your 404 error page"
icon: "file-warning"
---

You can control the title and description of the 404 error page that appears when users navigate to broken or missing links.

When customizing your 404 page, use the description to guide users to helpful resources or links in your documentation that can help them find what they're looking for.

## Configuration

Configure your 404 page in the `errors.404` section of your `docs.json` file:

```json
"errors": {
"404": {
"redirect": false,
"title": "I can't be found",
"description": "What ever **happened** to this _page_?"
}
}
```

### Parameters

<ResponseField name="redirect" type="boolean">
Whether to automatically redirect to the home page when a page is not found.

Set to `true` to redirect to the home page.

Set to `false` to show the custom 404 page.
</ResponseField>

<ResponseField name="title" type="string">
Custom title for the 404 error page. This replaces the default "Page not found" heading.
</ResponseField>

<ResponseField name="description" type="string">
Custom description for the 404 error page. Supports Markdown formatting.
</ResponseField>