How to create a custom 404 error page


Cyberspace is full of endless possibilities, decades ago when Internet was just a program used by defense, who would have imagined that this piece of technology will become milestone in the history of communication. I mean just look at the spectrum of things you can do with the help of internet. One of the most amazing things on internet today is making your own domain. You don't need to be some millionaire to start your own business, just a few bucks to buy your server space and designing your domain cleverly can earn you more money than you would have ever imagined.

So, now that you have gone ahead and made your own domain, you have to make sure you make the most out of it, after all its your business and maintaining and flourishing it takes more efforts. Imagine you want to have a coffee and you along with your friends walk towards a coffee shop, but unfortunately you read "CLOSED" sign board on the door. What will be your reaction? Obviously, you will walk towards another café, isn't it? But, what if the sign board said, "Will Open in 10 minutes". I am sure, if not all, atleast few of the customers would return after sometime, and enjoy their coffee.

Similarly, you have to select the right kind of words for your web site, which would create positive impact on your audience, which would make them visit your site again. At times, it may happen that your site is having some minor glitch and you're working on it. Who knows how many visitors would just run away after seeing that default 404 File Not Found error page, and never return thinking, this is one hell of a lousy web site.

To make this situation turn around, you can create custom 404 error page for your web site, which would provide more information to your visitors, hence retain the number of audience your site deserves. To create a customized 404 error page is not a painstaking job, but requires a little bit of hard work. First thing you will need to do is create an error page using HTML, like you did for the rest of your domain pages.

Thereafter you will have to customize your 404 error page, for which you will have to find the file named .htaccess in the main directory of your domain. If you don't find one, create one and name it .htaccess. If you find it, all you need to do it edit the file and change the url to the new error page that you have just created.
ErrorDocument 404 http://www.mydomainname.com/custom_error_page.html

While creating a new 404 error page, make sure you enter a link to your main page or site map, along with suggestions for the visitors which will make them feel, that though the site page is not working, the creator of this site has gone a step ahead to assist them. You can also put up a form, so visitors can inform you about the broken links on your domain, thus keeping you informed all the time. Once you are satisfied with the way you have customized your 404 error page, you can upload the .htaccess file to your web site. Test it by keying it some URL that does not exist on your web site and your new customized 404 error page will appear.



Posted by James on 2009-08-19 in the category " apache "