400 - Bad request
401 - Authorization Required
403 - Forbidden
404 - Not found
500 - Internal Server Error
are the most common errors. By adding a couple of lines to your .htaccess file you can display a page or redirect the user to a different URL when an error occurs.
Usage:
ErrorDocument error_code file or URL to display
A couple of examples;
ErrorDocument 404 http://www.yourdomain.com
This will redirect the user to yourdomain.com when a document cannot be found.
ErrorDocument 500 /blah.html
This will display the file blah.html when an internal server occurs. Remember, you need to create and upload a file with the name blah.html to the root directory of your site.
If you want to place your error pages other than the root directory;
ErrorDocument 404 /errors/page_404.html
ErrorDocument 500 /errors/page_500.html
ErrorDocument 500 /errors/page_500.html
Here's what I use on most of my sites;
ErrorDocument 400 http://www.domain.com
ErrorDocument 401 http://www.domain.com
ErrorDocument 403 http://www.domain.com
ErrorDocument 404 http://www.domain.com
ErrorDocument 500 /errors/page_500.html
ErrorDocument 401 http://www.domain.com
ErrorDocument 403 http://www.domain.com
ErrorDocument 404 http://www.domain.com
ErrorDocument 500 /errors/page_500.html
