.htaccess to Mask Errors on Your Website






The .htaccess file is a control file located in your webservers directory. This file is a very powerful file that can control access to certain files, restrict access to files, forward people in the event of errors, and many more useful features for webmasters!

One of the most embarrassing things for a webmaster is to have a website with dead links, bad URLs, and error messages when the user surfs through your website. Using the .htaccess file you can help reduce how noticeable those errors are by quickly moving the user to a correct working location. This method of course doesn't correct the underlying problem with your website, however it does help to keep your website looking more professional.



Common error codes that you want to try to hide from the user:

400 - Bad Request
401 - Authorization Required
403 - Forbidden
404 - Page Not Found
500 - Internal Server Error
501 - Not Implemented

The biggest and most common error by far is the 404 Error (Page not found), but all of these can be embarrassing and troublesome to webmasters. If an error occurs on your website you don't want to lose that user. You may not be able to provide them with a link to the page they wanted, but you might get another chance if you redirect them to another page within your website.

Syntax for .htaccess file:

ErrorDocument ### index.php -- Example of format
ErrorDocument 404 /index.php -- Working example

In the second example, should a user request a page that no longer exists on your website, they will automatically have the index.php file loaded. This can be done for all of the error codes listed above and will help to hide and glaring mistakes in your website.

As I mentioned before, this is not a fix action for your website, but simply a mask. It's very important to review your website logs and look for error codes. The goal is to have a good working website afterall!

Ken Dennis
http://KenDennis-RSS.homeip.net/

 Continue for more related information:

RELATED RESULTS:


 

7 Benefits of HTML Validation
You may not bother with html validation or writing simpleand clean code when designing your web site. Later you mayfind your site is sl...

Dont Lose The Sale In The Internets Last Three Feet
In retailing there is a saying that sales are made in the last three feet. What this means is that no matter what ...

10 Things All Webmasters Should Know
Geared Up with a website and lots of energy to make a mark online? Spare some time and go through this. You'll be glad you did. ...

How To Set Up A Professional Website On Your Own Using Web Templates
To create professional websites is not an easy task by any means. There are many things that you g...

Website Maintenance: What Does it Take to Manage Your Website?
Every action has a beginning phase where you launch your activity, a middle period in which you must s...

E-covers for Your Niche Market
When creating an e-cover the what's the first thought that comes to mind? How do I do it? What software do I need? How much will it c...

404 Error - The Page Cannot be Found
A "404 Error" happens when the web server you are on cannot find the page that you requested. This type of error is quite common...

A Website Checklist
If you've just finished building your new website (or revamping your old one), how can you be sure it's "ready for prime time"? Or maybe your site...

Database Driven Website
The solution lies in creating a 'Database driven website', through which web pages are created dynamically which further gives a web site vis...

Building a One-page Website
You've designed your logo, and you're ready to print your business cards and other marketing collateral materials. You want to include yo...

Table of Contents | Article-Max Directory