Strange issue with .htaccess and PHP 404 error document

Discussion in 'Apache' started by gct13, Jan 30, 2006.

  1. #1
    Hello, my PHP 404 document is not working anymore. This is the line I have in the .htaccess file:
    ErrorDocument 404 /404.php
    Code (markup):
    When a 404 is hit, it generates a blank page (which it should not). There's nothing in the source of the document.

    If I switch the .htaccess code to the following:
    ErrorDocument 404 http://www.domain.com/404.php
    Code (markup):
    The page renders correctly, but the url redirects direct to 404.php which is not the behavior I want, I want the url to stay on the actual error page.

    If I point the 404 to an .html document, the 404 works properly. But I need it to work on a PHP page.

    Anyone have any ideas? Thanks.
     
    gct13, Jan 30, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You should always use the absolute url to prevent any problems with errors inside directories etc.

    I take it http://www.domain .com/404.php can be loaded in your browser with no problems?

    I don't know of any way with htaccess to pull in a 404 document without redirecting to a 404 page. Did your site do this before?
     
    mad4, Jan 30, 2006 IP