Jump to content


Using .htaccess For Error Pages

  • This topic is locked This topic is locked
No replies to this topic

#1 TCH-Sales



  • Members
  • PipPipPipPip
  • 1,516 posts

Posted 03 September 2003 - 06:13 PM

Setting up your error documents through the .htaccess file is easier than one might think. Here’s an example of what you would want to cut and paste into your .htaccess file:

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 that each of these errors pages are in the /errors/ folder and the exact file that needs to be seen when somebody encounters that error.

Each line represents one error. For example, this

ErrorDocument 404 /errors/404.html

is the line for a 404 error, or the message you get when a page can not be found. You can change the path of the file you want the user to go to when they run into the error as well. Just change the “/errors/” to another path like “/static_pages/404.html”.

If you need to get more information on customizing your 404 error page, please check out this thread from the cPanel forms.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users