Home » Internet » Web Designing » How to create a custom 404 page not found error page

How to create a custom 404 page not found error page

Custom 404 error page

Image Source: willem velthoven

If you create a custom 404 page not found error page for your website you can instruct your visitors on what path to follow in case they come across a non-existent URL on your website or blog. This error is triggered when a visitor types in a link in your website that does not exist. Now, why would they end up on a non-existing URL, you might be wondering. Here are a few reasons why a visitor might get a 404 error

  • The page or the blog post used to be there, but now it has been removed, but the link still lurks around on other websites and search engine cache.
  • The URL got changed somewhere around and you didn’t notice.
  • Somebody referred somebody to a wrong URL.
  • Your visitor mistyped the URL.

Whatever is the reason, if your visitor comes to an unintentional dead-end, he or she might think that your website is down and might go to another website to do business. The worse case scenario is that he or she might tell his or her friends that your website doesn’t work. Just because you didn’t create a custom 404 page not found error page.

Creating a custom 404 page not found error page

If you’re managing your website through a content management system then your software must already have a feature on creating custom 404 page not found error pages. Go through the document and create a 404 page ASAP and then activate it. In case you’re using WordPress to manage your website or blog then creating a custom 404 page is extremely easily. Just create a custon 404.php file your current theme folder and you’re done.

For normal websites that are created manually, you first need to create your custom 404 page not found error page using your standard template. You can name the file anything, something like my404.html or 404page.php. After creating the file you need to modify your .htaccess file. This file resides in the root folder of your hosting account, so if it’s there, then download it so that you don’t mess up with the existing settings.

In that file you simply have to add

ErrorDocument 404 /404page.php

Why create a custom 404 page not found error page

You need to explain the situation to your visitors. Let it be known to him or her that he or she reached a page that does not exist, and give a proper reason. Don’t redirect the person to another page or the home page: this might cause confusion or even irritation. Offer alternatives, or advise the person to check out your sitemap instead.