Gzip compression can normally be enabled/disabled from the server level. However sometimes you may have to control the gzip compression for a particular virtual host through .htaccess
without affecting the global settings. There are two ways to turn off gzip dynamically:
SetEnv
/SetEnvIf
The latter is a better choice, as it won't be affected by other rewrite rules.
You can place the following in .htaccess
:
RewriteRule . - [E=no-gzip:1]
Be aware that other rewrite rules may affect it.
You can place the following in .htaccess
:
SetEnv no-gzip 1