Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I disable Apache compression per virtual host or per directory? Is this done through a modification to the http.conf file, a .htaccess file or something else?

share|improve this question
up vote 3 down vote accepted

This question on stackoverflow will probably help you.

I cite:

# for URL paths that begin with "/foo/bar/"
SetEnvIf Request_URI ^/foo/bar/ no-gzip=1

# for files that end with ".py"
<FilesMatch \.py$>
    SetEnv no-gzip 1

So you can try something like:

<Directory /home/user/www>
    SetEnv no-gzip 1
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.