Web Server Error Messages

When visiting websites, you can find a lot of uncanny 401, 404, 403 error pages. What do they mean?

400 - Bad file request. It means file exist on server, but wrong syntax used to get that file.

403 - Access denied. It means you need a username and password to enter this area or owner of site has some blocking of your IP or method you use.

Tip #1. For example, someone wants to use 'Web Downloader' to browse my site offline or just seeks illegally extract data from my site, I enter in .htaccess file (it sits on your website public html directory) few lines:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Web Downloader [NC]
RewriteRule ^.*$ blocked.html [L]


... and this 'visitor' gets 403 error, and is being redirected to my custom blocked.html page.

404 - File not found. File does not exist on server. Maybe owner changed address or deleted that file.

Tip #2. If you came from Google, you can see that file by clicking 'page cache'. If file is older than one month, you can try to locate it on Web Archive http://www.archive.org.

500 - Internal server error. It means there is a problem with server side script or server has configuration errors.

Tip #3. How to keep your visitors on your site when they get error files? Create your custom error files! And then add few lines into your .htaccess file:

ErrorDocument 404 http://www.your-domain.com/404.html

When page not found I like to use redirecting to main page instead of custom 'not found' page. Here's example:

ErrorDocument 404 http://www.zongoo.com ErrorDocument 403 http://www.zongoo.com/blocked.html

Article by Tadas Talaikis, software engineer, self-help guru, and owner of http://www.zongoo.com. Drop me a note if you need help.

Share This Articles:
Rate This Article:
 
AddThis Social Bookmark Button
Not so Great Article >> 1 2 3 4 5 << Great Article
 
Social BookMark it!:
Your feedback is appreciated! Please take the time to rate this article.
 
About this author

 
Related articles

Turn Harmful 404 Error Pages Into Helpful 301 Redirects
It's a fact, Page Not Found, known as a 404 error, can harm your website Ranking with Search Engines as well as being a Turn-Off for Visitors. Visitors are just one click away from clicking to another website. Present them with a page not found 404 error and these days they'll not stick around long enough to search for your missing page. Avoid turning away visitors by learning how to use search engine and visitor friendly redirects.

Easy Domain Migration To a New Unix Server
Switching web providers or installing a new server entails migrating all your domain's web pages and other files.