Apache .htaccess: ErrorDocument and RewriteEngine not working together

Posted by bogdanvursu on Stack Overflow See other posts from Stack Overflow or by bogdanvursu
Published on 2010-03-17T10:50:35Z Indexed on 2010/03/19 11:01 UTC
Read the original article Hit count: 245

Filed under:
|
|
|

Please take a look at the following .htaccess

ErrorDocument 404 /404/

RewriteEngine On
RewriteRule (.*) index.php [L]

With this setup, I am using header('HTTP/1.1 404 Not Found'); in PHP to redirect to the error handling page and send the appropriate HTTP status code. The correct 404 status code is sent, but the browser shows a blank page and the access log shows "GET /invalid-url/ HTTP/1.1" 404 -

Can anyone tell me how to make ErrorDocument work with Apache URL rewrites?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about php