Create a 404 page

Contributors

@brandon-leuangpaseuth @andreea-macoveiciuc-content-expert


Business Benefits

Keep visitors on your website and turn a negative experience from a not-found URL to a positive experience.


Decide what feel you want visitors to get from your 404 page. You can choose to go with funny and creative, or serious.

Note down sections you want to add. Here are some ideas: you can choose to add links to important areas of your website such as top blog posts or pages, a search bar, and a clear statement that the URL the website visitor requested is not available.

Design your 404 page as a standard web page, including all the elements that you decided on in the previous step.

You can also ensure that your header and footer menu are visible on the 404 page to aid navigation. When done, save the page as 404.html.

If your website is on WordPress, save your page as 404.php.

If you don’t know coding and design, reach out to a web designer with a list of the things you decided on in step one to design your 404 page.

Upload your 404.html file to the root directory in your web hosting or server control panel.

If your website is on WordPress, navigate to your theme folder on your server. It’s in wp-content > themes in your website folder. Upload your 404.php file in the child theme folder. You can jump to step six.

If you are using an Apache server, type or paste the following “ErrorDocument 404 /404.html” in notepad or similar application. Save the file as .htaccess.

This is for those using Apache servers; most hosting companies provide Apache to shared hosting customers.

Upload your .htaccess file to the root directory of your website in your web hosting server control panel.

Test your 404 page by typing a random page that doesn’t exist in your web browser.

Type in your domain then a page that doesn’t exist, for example, https://mydomain.com/randompage.

Your 404.html or 404.php page should show up.

Last edited by @hesh_fekry 2023-11-14T12:35:22Z