Skip to content

Commit 686a5f0

Browse files
committed
Guide about custom 404 pages
Small guide mentioning how Read the Docs find the 404.html file and suggesting sphinx-notfound-page to generate this HTML easily.
1 parent 900c575 commit 686a5f0

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 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`` on the root of your project's 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 for the 404 page than your theme in an easy way,
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 helps you to create and automatically arrange all the URLs and file location without worry about them.
22+
Once the extension is installed into Sphinx, it will generate the default 404 page for your.
23+
See its documentation_ for better customization.
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)