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?

Matteo Riva
  • 297
  • 3
  • 14

1 Answers1

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.

cyberx86
  • 20,620
  • 1
  • 60
  • 80
  • 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 – Matteo Riva Jul 07 '11 at 09:39