I noticed an error in google webmaster tools regarding a gzipped version of a sitemap. Turns out the sitemap.xml.gz
file is gzipped twice: one upon creation (as it should be) and another time when being served.
The .htaccess
file has this rule
AddOutputFilterByType DEFLATE application/xml
which I thought wouldn't match a gzipped XML file, but apparently it does as removing this solves the problem.
What am I doing wrong?
The
.xml.gz
filetype may be defined as being an xml file (e.g. with forcetype in a filesmatch block) - which would cause Apache to match it to the type above.I think you can get around that by adding an exception, above it:
SetEnvIfNoCase Request_URI ".xml.gz$" no-gzip dont-vary
You might want to see HowToForge for more exceptions to add.
Hope it works for you.