Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to disable gzip compression in my site using htaccess.

I have the code below in htaccess:

php_flag zlib.output_compression off

But it is not working.

share|improve this question
1  
How is gzip compression currently implemented on your site? Do you wish to disable compression for the whole site, or just certain files? –  w3d May 1 at 9:17

2 Answers 2

up vote 3 down vote accepted

Check here: http://stackoverflow.com/questions/9249243/how-to-disable-apache-gzip-compression-for-some-media-files-in-htaccess-file

It's possible, but looks like it will disable gzip for the whole website.

Keep in mind that you are telling PHP not to gzip, but Apache may still be gzipping so this should sort it, but check Apache config.

RewriteRule ^(.*)$ $1 [NS,E=no-gzip:1,E=dont-vary:1]
share|improve this answer
    
In the linked question, "global" refers to the whole site, not "every site hosted on [the] server" - if that is what you were referring to? –  w3d May 1 at 9:26
    
thanks for reply –  Amit Bera May 1 at 10:09
    
@w3d Your right on that one. I'll update answer. –  Clarkey May 1 at 12:11

A simpler one that also works:
SetEnv no-gzip 1

The line you were using disables PHP's compression. The no-gzip env variable, on the other hand, disables Apache compression.

share|improve this answer

Your Answer

 
discard

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.