We are hosting a number of .tar.gz files on our Apache server. When we download these files, the filename of the downloaded file is the same as on the server... something.tar.gz... but the file is actually an uncompressed tarball (as if just a .tar).

The response headers include

Content-Type: application/x-gzip
Content-Encoding: x-gzip

What Apache configuration can be used to cause these files to be downloaded as gzipped tarballs still named .tar.gz?


I had to add the following directive to get intentionally gzipped files to download without silently decompressing:

AddEncoding x-identity .tar.gz .gz .tgz
| improve this answer | |

The problematic configuration was having both

AddEncoding x-gzip .gz .tgz


AddType application/x-gzip .gz .tgz

Removing the AddEncoding line fixed the problem.

| improve this answer | |

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.