Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
litespeed_wiki:config:gzip-compression-enable-globally-disable-vh [2018/09/07 16:07] Jackson Zhang [User SetEnv/SetEnvIf in .htaccess] |
litespeed_wiki:config:gzip-compression-enable-globally-disable-vh [2018/09/07 18:24] Lisa Clarke Proofreading |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== How to disable gzip compression on VH level while enabled globally? ====== | + | ====== Disable gzip Compression at the Virtual Host Level ====== |
- | Gzip compression can normally be [[litespeed_wiki:config:gzip-compression|enabled/disabled from server level]]. However sometime you may have to control the gzip compression for a particular virtual host through .htaccess to override server setttings. There are two ways to turn off gzip dynamically, either with a rewrite rule or SetEnv/SetEnvIf in .htaccess. SetEnv/SetEnvIf is better as it wont be affected by other rewrite rules. | + | Gzip compression can normally be [[litespeed_wiki:config:gzip-compression|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: |
- | ===== Use rewrite rule in .htaccess ===== | + | - a rewrite rule |
+ | - ''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: | + | ===== Use a Rewrite Rule in .htaccess ===== |
+ | You can place the following in ''.htaccess'': | ||
RewriteRule . - [E=no-gzip:1] | RewriteRule . - [E=no-gzip:1] | ||
| | ||
- | but be aware that other rewrite rules may affect it. | + | Be aware that other rewrite rules may affect it. |
- | ===== User SetEnv/SetEnvIf in .htaccess ===== | + | ===== Use SetEnv/SetEnvIf in .htaccess ===== |
- | You can place the following in .htaccess: | + | You can place the following in ''.htaccess'': |
SetEnv no-gzip 1 | SetEnv no-gzip 1 | ||
- | |||