Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How to set up apache to serve no error page content? I don't want the default behavior, blank or custom page. I want return no content except headers, that all browsers must display own native error page. I'm using Apache 2.2.22

share|improve this question

2 Answers 2

up vote 2 down vote accepted

I'm fairly sure you can't do this Apache goes to some lengths to be helpful. From the ErrorDocument documentation

In the event of a problem or error, Apache httpd can be configured to do one of four things,

  1. output a simple hardcoded error message

the rest being custom/local/and remote error documents. Later the documentation says

Additionally, the special value default can be used to specify Apache httpd's simple hardcoded message.

So it appears that the default behaviour is to provide a hard coded ErrorDocument and that you can't override that in the way that you want.

share|improve this answer
    
It's not so good... –  kbec May 16 '12 at 8:48

Have you tried setting empty ErrorDocument directives? Did it work?

ErrorDocument 404 ""

Or

ErrorDocument 404 /path/to/empty/file.html

Apache might be helpful and ignore empty values so you may have to send a space or a <html></html> to prevent it from overriding your values.

It's worth mentioning that browsers don't have error pages for all the different possible error codes. It is the Server's responsibility to provide those pages. When browsers do display their own error pages, it's likely that it will be generic and misleading.

Internet Explorer is unique in thinking it knows better than the server and will override your error pages if they are less than 512 bytes. The others only provide error pages for the situations where the server can't such as a DNS lookup error, a reset connection or a redirect loop. In most browsers, what you will get if you send an empty error document is a blank page.

share|improve this answer
    
When I use "" the apache reported ErrorDocument takes two arguments, Change responses for HTTP errors on restart. Second solution is just blank page and browser display it either own page. In some random cases my Chrome relly display own errpage, but not always. Maybe if I can change/remove content type it can work, but how? –  kbec May 16 '12 at 8:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.