.htaccess errordocument disable header

nrofis asked:

I want to redirect error to specific page, so i wrote:

ErrorDocument 403 /error403.html

This is working, but in the HTTP response header I can still see HTTP/1.1 403 Forbidden.

Some browsers (like IE) that see that message, ignores the HTML code in the response (of error403.html), and showing their own page instead.

Is there any way to tell the server that if ErrorDocument handles an error, it will not include the HTTP error header?

My answer:


Internet Explorer is silly and displays its own custom error pages instead of yours, if your error page is less than 512 bytes after compression. Make your error page at least 512 bytes (maybe add a long HTML comment, if you don’t have that much to say).


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.