.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/

In The News:


pen paper and inkwell


cat break through


Make it Clear What Your Website is About

Just about every list of the "Top 10 Web Design... Read More

Custom Website Design - 7 Steps to a More Professional Website

If you are trying to sell a product or service... Read More

How To Give Your Business Credibility

Let's face it. Buying products and services from the Internet... Read More

Keep Your Navigation Highly Visible

Effective navigation stands out. It's clear, obvious, and highly visible.You'll... Read More

The Technology May Change, But Human Nature Remains The Same

Let me repeat that.."The technology may change, but human nature... Read More

Will You Site be a BIG SUCCESS. 7 Reasons Why It Might Not!

With so many new websites going up, it is hard... Read More

Website Design: Color Me Blue

Chris, a new consulting client, asked me to help him... Read More

The Newbie?s Guide to Small Business Web Design

You've got a concept for a business, are excited about... Read More

How To Make It Easy For Your Web Designer To Build Your Website

You have an idea for a website and you are... Read More

How To Create A Homepage That Works

Want to know what the worst thing to say on... Read More

Cascading Style Sheets for Better Web Design

In cascading style sheets you can specify how your web... Read More

Website Creativity: Why It Matters Now More than Ever

If one more business owner tells me their website sucks... Read More

Web Designers Beware!

As a web designer, I have a personal interest in... Read More

Web Designing Tips

Easy That's how you'd like life to be, right? Especially... Read More

Awards Program Debate

Daily article:One of the most debated subject among webmasters is... Read More

Owning Your Own Web Site Is A Must

Owning your own website is a must if you are... Read More

Design Your Site For Your Customers

The most important person that you need to please when... Read More

How To Choose A Website Designer

When you're self-employed, choosing a website designer is a crucial... Read More

Building a One-page Website

You've designed your logo, and you're ready to print your... Read More

Creating Your First Website

Building your first website can be very frustrating. It looks... Read More

Top Ten Ways to Increase Web Sales - Part 2

You have only 10 seconds to impress your potential buyer.... Read More

Plugging the Dreaded World Wide Web Black Hole is Just the First Step

You have created your custom error page so now all... Read More

The Best Simple Software For The Busy Webmaster

Here are a few programs I can't do without. They're... Read More

What Content to Publish on Your Website

Many businesses want a simple website where they tell people... Read More

Leave Those Links Blue!

Don't mess with those links! When you're designing your site,... Read More

Web Marketing: Design Mistakes That Drive Customers Away In Droves

They may look cutting edge, but if you want a... Read More

Do You Make These Common (But Deadly) Website Design Mistakes?

Building a website can be overwhelming, here are some design... Read More

How Important is Content to a Successful Website

Content is the most important part of any website.The Internet... Read More

Turn Harmful 404 Error Pages Into Helpful 301 Redirects

It's a fact, Page Not Found, known as a 404... Read More

Graphic Design Can Make or Break Your Web Site

We all want high impact graphics for our Web sites... Read More

Build It And Build It Cheap! Part II

If you are familiar with my work, then you have... Read More

Build A Successful Website For Dummies

So you want to build a website here I will... Read More

5 Ways To Automate Your Site

Automating your online business is one of the most important... Read More