Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When attempting to validate my site with the W3C validator, it returns the error, "Don't know how to decode Content-Encoding 'none'". Firebug confirms that my server is sending the header, "Content-Encoding: none".

But I can't find any directive in apache2.conf or in my vhost that sets the Content-Encoding header.

Where does the directive go, and what should it be set to?


On further examination it seems something is wrong with mod_deflate (gzip). It's zipping my css files just fine, but is not zipping the html generated by my php scripts.

I have:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css

And the pages are showing a mime type of: "text/html". But content encoding is "none" and they aren't zipping. Perhaps these issues are related?

share|improve this question
up vote 0 down vote accepted

The header was being set by the PHP script, not in Apache. I didn't even think to look there until I stumbled on it by accident.

share|improve this answer

Your syntax looks right. What is the encoding for static .html files? If those are fine, look at how you are generating HTML from PHP ... perhaps ... ?

share|improve this answer
My robots.txt file is gziped, and error messages (404, etc) are too. But my php files on this particular vhost are showing "content-encoding: none". On another vhost, php files are zipped correctly. The only difference I can see is that the files are delivered via mod_rewrite on the problem vhost, and "straight" on the one that works. Wonder if that's a known issue? – Nick Aug 24 '10 at 6:19
Could be ... any chance you have a vhost were you can reproduce this? I glanced at the apache docs for mod_rewrite ( but didn't see anything there. Or ... try moving the "AddOutputFilterByType" line before (or after) the rewrites ... ? – KM. Aug 24 '10 at 19:54

Your Answer


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.