From cff5f3e77485c86ad97c2e8cca8d5f1e8c3f9751 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 11 Jan 2015 18:54:15 -0800 Subject: [PATCH] Add custom 404 page to Tips section of docs --- docs/tips.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/tips.rst b/docs/tips.rst index eb400124..fdd57398 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -3,6 +3,32 @@ Tips Here are some tips about Pelican that you might find useful. +Custom 404 Pages +================ + +When a browser requests a resource that the web server cannot find, the web +server usually displays a generic "File not found" (404) error page that can be +stark and unsightly. One way to provide an error page that matches the theme +of your site is to create a custom 404 page, such as this Markdown-formatted +example:: + + Title: Not Found + Status: hidden + Save_as: 404.html + + The requested item could not be located. Perhaps you might want to check + the [Archives](/archives.html)? + +The next step is to configure your web server to display this custom page +instead of its default 404 page. For Nginx, add the following to your +configuration file's ``location`` block:: + + error_page 404 /404.html; + +For Apache:: + + ErrorDocument 404 /404.html + Publishing to GitHub ====================