Setting Up Custom Error Pages

Share |

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.html
ErrorDocument 401 /errors/401.html
ErrorDocument 403 /errors/403.html
ErrorDocument 404 /errors/404.html
ErrorDocument 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.

3 Responses to “Setting Up Custom Error Pages”

  1. Lunartics Benny Says:

    Thanks for this one as well. Nice to have this saved somewhere for a quick 404 emergency. ;)

  2. Lunartics Mikie Says:

    Very neat!

  3. Lunartics Silver Web Solutions Says:

    Yes, this is so important! I utilize these for not only navigation purposes, but also for SEO (Search Engine Optimization) purposes.

More Web Hosting Help