About Custom 404 Pages
It is recommended to create a custom 404 page to help visitors find the information they're looking for.
Custom 404 pages can be a standard HTML page, you can customize it any way you want.
Below are Googles 5 best practice tips for custom 404 pages.
- Tell visitors clearly that the page they're looking for can't be found. Use language that is friendly and inviting.
- Make sure your 404 page uses the same look and feel (including navigation) as the rest of your site.
- Consider adding links to your most popular articles or posts, as well as a link to your site's home page.
- Think about providing a way for users to report a broken link.
- No matter how beautiful and useful your custom 404 page is, you probably don't want it to appear in Google search results. To prevent 404 pages from being indexed by Google and other search engines, make sure that your web server returns an actual 404 HTTP status code when a missing page is requested.
To check a broken links status code you can use the following tool: (Enter a URL into the search tool that you know does not exist on your website. In this instance, I used https://cyberseo.co.za/dead-page)
http://tools.seobook.com/server-header-checker/
The Server Header Checker should respond with a status code of 404 not found (Response HTTP/1.1 404 Not Found)
How To Create A Custom 404 Page
First, create a standard HTML page (preferably a copy of your theme template) and make sure you include important navigation. Then name the page. In this instance, I named the page 404.htmlOn Apache server add the following rewrite rule to the .htaccess file:
RewriteEngine on
ErrorDocument 404 /404.html
And that's it. When a user clicks on a broken link they will automatically be redirected to the custom 404 page (404.html)