7

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?

1 Answer 1

7

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.

1
  • This works perfectly, although I haven't found anything in the htaccess or in the vhost configuration which would force gzip files to have application/xml MIME type Commented Jul 7, 2011 at 9:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .