Setting Up Custom Error Pages
Author: Mitch Keeler
Ever check out some of those customized error pages and wonder how it could be done? The process if fairly easy and the magic can be worked with just a little editing to your .htaccess file. As an example, here is the code that would need to be copied and pasted into your .htaccess file to get this customized error page effect:
ErrorDocument 400 /errors/400.htmlErrorDocument 401 /errors/401.htmlErrorDocument 403 /errors/403.htmlErrorDocument 404 /errors/404.htmlErrorDocument 500 /errors/500.html
This tells the server to look inside the “errors” folder and that specific page for each of the different error types. Which is which?
400 – Bad Request
401 – Unauthorized
403 – Forbidden
404 – File Not Found
500 - Server Error
That is not all of the error codes, but they are the ones that will be ‘hit by your users 99 percent of the time. Now instead of being taken to the default error page for the server – you can have your own customized error page for your clients to see when something goes wrong.




February 26th, 2008 at 7:13 am
Thanks for this one as well. Nice to have this saved somewhere for a quick 404 emergency.
February 26th, 2008 at 7:14 am
Very neat!
February 28th, 2008 at 7:46 am
Yes, this is so important! I utilize these for not only navigation purposes, but also for SEO (Search Engine Optimization) purposes.