Skip to content

Commit 87f65a4

Browse files
authored
Merge pull request #5738 from rtfd/humitos/custom-404-docs
Guide about custom 404 pages
2 parents 20b0285 + 8444540 commit 87f65a4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/guides/custom-404-page.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Use custom ``404 Not Found`` page on my project
2+
===============================================
3+
4+
If you want your project to use a custom page for not found pages instead of the "Maze Found" default one,
5+
you can put a ``404.html`` at the top level of your project's HTML output.
6+
7+
When a 404 is returned, Read the Docs checks if there is a ``404.html`` in the root of your project's output and uses it if it exists.
8+
9+
As the ``404.html`` will be returned for all the URLs where the real page was not found,
10+
all its resources URLs and links must be absolute (starting with a ``/``),
11+
otherwise they will not work when a user clicks on them.
12+
13+
In case you don't want to deal with these links manually,
14+
or you want to use the same style as your theme,
15+
you can use the `sphinx-notfound-page`_ extension.
16+
17+
18+
Using ``sphinx-notfound-page`` extension
19+
----------------------------------------
20+
21+
The ``sphinx-notfound-page`` extension automatically creates the proper URLs for your 404 page.
22+
Once the extension is installed, it will generate the default 404 page for your project.
23+
See its documentation_ for how to install and custom it.
24+
25+
26+
.. _sphinx-notfound-page: https://pypi.org/project/sphinx-notfound-page
27+
.. _documentation: https://sphinx-notfound-page.readthedocs.io/

0 commit comments

Comments
 (0)