Skip to content

Commit d5f4b8e

Browse files
Added custom 404 page documentation (#1123)
* Update settings/custom-404-page.mdx * Update docs.json * add icon * move to guides * copy edit * remove duplicate example * consolidate best practices in the intro * change heading level --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
1 parent 78d1b2a commit d5f4b8e

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
"guides/changelogs",
145145
"guides/hidden-pages",
146146
"settings/broken-links",
147+
"settings/custom-404-page",
147148
"guides/monorepo",
148149
{
149150
"group": "Custom Subdirectory",

settings/custom-404-page.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "Custom 404 page"
3+
description: "Customize the title and description of your 404 error page"
4+
icon: "file-warning"
5+
---
6+
7+
You can control the title and description of the 404 error page that appears when users navigate to broken or missing links.
8+
9+
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.
10+
11+
## Configuration
12+
13+
Configure your 404 page in the `errors.404` section of your `docs.json` file:
14+
15+
```json
16+
"errors": {
17+
"404": {
18+
"redirect": false,
19+
"title": "I can't be found",
20+
"description": "What ever **happened** to this _page_?"
21+
}
22+
}
23+
```
24+
25+
## Parameters
26+
27+
<ResponseField name="redirect" type="boolean">
28+
Whether to automatically redirect to the home page when a page is not found.
29+
30+
Set to `true` to redirect to the home page.
31+
32+
Set to `false` to show the custom 404 page.
33+
</ResponseField>
34+
35+
<ResponseField name="title" type="string">
36+
Custom title for the 404 error page. This replaces the default "Page not found" heading.
37+
</ResponseField>
38+
39+
<ResponseField name="description" type="string">
40+
Custom description for the 404 error page. Supports Markdown formatting.
41+
</ResponseField>

0 commit comments

Comments
 (0)