Creating a custom 404 Not Found page for your website is a very important step in establishing your business as an professional and creditable source. You lose a visitor each time you, or they, misspell a page address, and most people will not have a very good opinion of your site if it happens too often. If, however, you create your own custom 404 Not Found page, you can redirect the visitor to a search page, or back to your home page, so that you can continue to keep them on your site and browsing. I own multiple websites, and occasionally work as a designer for other people’s websites, and creating a custom 404 Not Found Page is a very important step that I always take.
To get started, you need to check with your webhost to see if you are allowed to access the .htaccess file that should be in the base directory of your homepage. If you are, then you can change the generic 404 Not Found page from their browser’s default to your own custom page. If you cannot find this file, then you may not be able to create a custom page.
Once you find this file, open it using Notepad, or whichever .txt editor you please. Notepad is the default on most computers with net cms. Now, to create a redirect to your custom 404 Not Found page, just add the following line to your .htaccess file:
Errordocument 404 /notfound.html
Save this document, and then go about adding a file called notfound.html to the base directory of your website.
On this notfound.html file, you have two basic options. The first is to redirect visitors to your homepage. This is a very viable option, but can frustrate visitors if, for instance, they were trying to access the third page in a multi-page document. When this happens, they need to then go back through and find the document they were at before, then click through again to hopefully find the page they were looking for. This doesn’t work for everyone’s webpages, but for the more basic pages, it works out just fine.
The second, and preferred option, would be to direct them to a search page. If you already have a page that searches, then this would be an appropriate choice for your custom 404 page (just copy that search page and rename it). You might also want a line added to the Not Found page which states that you couldn’t find the specified file. That way, you’re not confusing the visitor with an unexpected page.
If you do not have a search function already, or you do not know how to program a search function, take advantage of Google. If you use Adsense, you can add a search function that can actually make you some money if visitors are using it frequently (which, hopefully is not the case, but it works out well either way). Just sign up for the Adsense service and add the search code to the appropriate section of your website.
That’s all there is to adding a custom 404 Not Found page to your website. Most paid web hosts will allow you to change the 404 Page to your liking, while most free hosts will use their own to give you some added difficulty. In general, I recommend Cyberland USA hosting, because it is cheap and gives you the widest variety of options.