Apache 2.2.2 response on HEAD requests

2020-05-03 01:28发布

问题:

Seems that Apache insists on removing the "Content-Length" header when sending a response to a HEAD request.

Is there a way to configure it (or code it in PHP) to send "Content-Length: 0" for such responses?

For some weird reason it breaks the client (which is not under my control).

回答1:

One thing to look at would be mod_filter config. Look in modules/http/http_filters. Apache sends Content-Length by default, your host or environment may have disabled.

You might have better luck with this over at serverfault.