Sitemap compressed is in unsupported format but valid if uncompressed

by user305883   Last Updated April 07, 2016 08:01 AM

I've build a sitemap_index pointing to different sitemaps "sitemap1.xml" If they are uncompressed, they are successfully validated and accepted (Google Webmaster).

However, when compressed, they are not accepted.

sitemap - unsopported format

I simply compressed them using gzip:

gzip sitemap1.xml

My server nginx is enabled to send compressed files.

This time I have not found useful the link in "Sitemap guidelines": Which could be a possible error and how to check for it?



Answers 2


If you try to download your own sitemap files, e.g. example.xml.gz, most web browsers will correctly prompt you to download the compressed sitemap file.

However, if your webserver is not sending correct MIME headers for .gz files, some browsers may instead try open the sitemap file. This will fail as the internet browser has not correctly recognized the file format.

Josip Ivic
Josip Ivic
April 07, 2016 14:22 PM

I simply compressed them using gzip: gzip sitemap1.xml

My server nginx is enabled to send compressed files.

It looks like you're trying to send a double-compressed file and a compressed file.

When you gzip a file and host it on a server that is set up to compress and send files, then you basically compressed the same file twice and when one level of decoding is done, what google sees instead of the xml contents is a bunch of garbage which really is the compressed file that you made using the gzip utility.

I would suggest disabling the compression mechanism in nginx for gz files, and compress the xml files as gz files then when google requests them, they're compressed properly. On my site, I have the sitemap index file as just a plain old XML file and then the sitemap files within it are compressed manually and without the server running the compression module.

Mike
Mike
April 09, 2016 03:40 AM

Related Questions


Updated November 29, 2018 18:04 PM

Updated August 28, 2019 17:04 PM

Updated July 06, 2016 09:01 AM

Updated April 17, 2015 21:01 PM

Updated April 15, 2016 08:01 AM