DreamHost Custom 404

404 error happens when a visitor enters wrong path on your website. If you check your server log then you will find that there are many 404 error. These error happens because either they came to your site with wrong URL or they misspelled the URL while entering.

Whenever this 404 error happens, the visitor gets the default 404 error page. The default page contain only error code, no extra information and looks like following.

Default 404 Error page

You can see from the above screenshot that the 404 error page doesn’t have any other information. You also won’t get any other way to get out of this page. There are no links on the page. If visitor lands on 404 error page then she has no otherway than closing the page. If that happens that means all your promotion strategies are failed. If visitor comes to your site and leaves without reading a single word from your site that’s failure.

If you create custom 404 error page then you will add your website’s internal links on the page. You will also add the search box on the page. So that once visitor comes on the page, she has more options to stay on your website.

Create Custom 404 Page

To setup the custom 404 page, the first thing you will need is custom 404 page. So first create the custom 404 error page. You can give it any name. For the simplification of understanding, we will name our custom 404 error page, notfound.html.

Also make sure that you add some internal links of website on the custom 404 error page. You can also add navigation link. It is also a good practice to add google search box on the custom 404 page. Visitor should have as much as possible options to stay on the site. You can also recommend visitor to visit sitemap page to find out the necessary information.

DreamHost Custom 404 error page

Set Up 404 Redirect

Once the custom 404 error page is created, the next step is to set it instead of default 404 error page. So whenever 404 error happens, visitor should be redirected to the newly created page at notfound.html. We will do this using .htaccess file. Add the following link in the .htaccess.

ErrorDocument 404 /notfound.html

If you can’t see .htaccess file then make sure that you have selected the option to see hidden files. If that option is checked and still you can’t see the file then create a simple text file under the root of the domain and give it a name .htaccess. Then you can add the above entry in the file.

You also need to make sure that you have uploaded the notfound.html file on the server. Visit the URL and make sure that the page is properly loading.

You have now setup custom 404 error page. Visit any URL on your site which doesn’t exist. You should see notfound.html page instead of default 404 error page.

I hope you will enjoy the article on custom 404 error page. Now go ahead create one custom 404 error page for your website.