lighttpd 1.4.31-4+deb7u3
automatically adds ;charset=UTF-8
to the content-type
of .html
and .php
files.
How can I remove that?
Setting the content type in PHP itself does not help; lighttpd still adds the charset parameter - as soon as the mime type begins with text/
.
Removing
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
from my config does also not help.
Lighttpd doesn't touch the Content-Type returned by a backend.
The charset is already set by php, see ini.default-charset
You need to edit
/etc/php.ini
and add this line:They changed the behavior recently to automatically add UTF-8. What's worse, they auto-add
Content-type
[sic] instead of the correct capitalized ...Type
which causes the header to get ignored in some versions of Chrome.The decision obviously breaks configs with different encodings contained in the HTML itself.