Monday, 13 January 2014

Custom 404 error page!

While you work  really hard to be assure  that every link of your site goes to a specific web page, but there is always a chance that a link clicked will slam dunk and become a 404 ERROR PAGE NOT FOUND.

Now let's do a quick analysis : what do you usually do when you encounter a "404 File Not Found" error?
Do you:  Click on the BACK button of your browser and go somewhere else?  that's what we all do.

Custom 404  is a web page which is being used by all websites to show the error when someone enters into a broken or not found location. In other words, when you enter an incorrect address then the custom 404 page appears. Basically, In that page the error message and some options are added for better navigation.

Different web server handle 404 page differently. The .htaccess file is what Apache web servers use to allow you to fine-tune your web server configurations at a directory level.

Process of Customizing 404 Error page:

Modifying the .htaccess File

Add this to the .htaccess file:

That's it. You are done. Now you just need to put a 404.php file in the main web directory for the above directive to work. 

Create your 404 page:

You have to create your customize 404 page where  you can provide  the user some way to locate the document they want, or a link to your main page, with a suggestion that the visitor can find what he/she wants there. you can also provide a  link to your site map, which lists all the pages on your website. If you know of frequently mistypes URLs on your site, you can even put links to the correct location directly on the page, so that visitors who arrive there from outside can quickly get to the correct page.

Testing the Error Document

When you're done with your 404 page, upload it together with your .htaccess file to your website. Then test it by typing a URL that you know does not exist.

Your error page should load up. From this error page, test to see that the links here lead to the pages you intended it to lead. 


You loose your visitors when they encounter  a 404 File Not Found error on your site, you work really hard to obtain those visitors through the search engines and third party links. Creating your customize 404 error page allows you to minimize the number of visitors lost that way. 

Thanks for reading my blog. enjoy..

No comments:

Post a Comment