This post explains how to create Custom Error Pages with .htaccess mod redirection. Before trying this you have to enable mod_rewrite.so module at httpd.conf.
For more information about htaccess and mod_rewrite go to my previous tutorial http://www.91weblessons.com/what-is-htaccess
We can use custom error pages for any error as long as you know its number by adding the following code in htaccess file.
ErrorDocument 404 /pageNotFound.html
In this htaccess rule if the file is not in the root directory of your site, url will be redirect to pageNotFound.html.
These are some of the common errors:
400 – Bad request
401 – Authorization Required
403 – Forbidden
404 – Wrong page
500 – Internal Server Error