by Tadas Talaikis
------------------------------------------------
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.
------------------------------------------------


Ask About This Article