.htaccess redirecting to error pages

Discussion in 'Apache' started by ndogg, Jul 4, 2006.

  1. #1
    I recently set up an .htaccess file to give custom warnings for the most common errors -- 300, 403, 404, etc. I followed this format:
    ErrorDocument 400 http://www.domain.com/error/400.html
    ErrorDocument 403 http://www.domain.com/error/403.html
    ErrorDocument 404 http://www.domain.com/error/404.html
    ErrorDocument 500 http://www.domain.com/error/500.html
    Code (markup):
    But instead of just showing the error message in the HTML files, the browser is redirected to the actual URL of the error. How can I have it just embed what's in the error message's HTML files?
     
    ndogg, Jul 4, 2006 IP
  2. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #2
    Try putting all those in the root directory as follows:

    ErrorDocument 400 /400.htm
    ErrorDocument 403 /403.htm
    ErrorDocument 404 /404.htm
    ErrorDocument 500 /500.htm
    
    Code (markup):
     
    minstrel, Jul 4, 2006 IP