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?


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.


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 ... ?

  • 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 (httpd.apache.org/docs/2.2/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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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