Cant get ErrorDocument to work in .htaccess

Discussion in 'Apache' started by tsrwebman, Apr 4, 2008.

  1. #1
    I have
    
    ErrorDocument 401 /error_docs/unauthorised.php
    ErrorDocument 403 /error_docs/forbidden.php
    ErrorDocument 404 /error_docs/not_found.php
    ErrorDocument 500 /error_docs/internal_server_error.php
    
    Code (markup):
    in my .htaccess file which is located in the root folder of my website.

    http://www.telfordsteamrailway.co.uk/error_docs/unauthorised.php
    works when accessed directly - as do the others.

    with the .htaccess file removed accessing
    http://www.telfordsteamrailway.co.uk/appearance gives a file list
    with the .htaccess file in place I expected to get one of the error docs served - instead - well - try it - the error from IE is 'unable to download'
    and with firefox it returns what appears to be binary

    I have posted http://www.telfordsteamrailway.co.uk/test.php which shows all the environment settings - but I have no control over these as they are down to the ISP

    Any help appreciated
     
    tsrwebman, Apr 4, 2008 IP
  2. tsrwebman

    tsrwebman Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I have it working now - but I dont understand why it failed.
    It seems the
    causes the problem when an error page is served.
    Took it out and now error pages work!!!
     
    tsrwebman, Apr 4, 2008 IP