Title: [Plugin: WP Super Cache] mod_rewrite rules stop gzip
Last modified: August 20, 2016

---

# [Plugin: WP Super Cache] mod_rewrite rules stop gzip

 *  [Simon_82](https://wordpress.org/support/users/simon_82/)
 * (@simon_82)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-mod_rewrite-rules-stop-gzip/)
 * Hi folks,
 * I have a problem with the WP Super Cache plugin: It seems to stop gzip from working.
 * My hoster’s Apache servers have the gzip module installed. All I had to do was
   to insert `mod_gzip_on Yes` in the htaccess file and several html compression
   checks indicated that my site was compressed.
 * When I installed the WP Super Cache plugin, it stopped gzip. When I select _chaching
   off_ in the settings gzip works. When I turn it on again, gzip stops.
 * It seems that WP Cache Plugin mod_rewrite rules are the problem, as the message
   below reveals:
 * > Notice: PHP caching enabled but Supercache mod_rewrite rules detected. Cached
   > files will be served using those rules. If your site is working ok please ignore
   > this message or you can edit the .htaccess file in the root of your install
   > and remove the SuperCache rules.
 * Below are WP Super Cache mod_rewrite rules from the htaccess file. What do I 
   have to do to make this work? Delete all of them? Or just some of them? And wouldn’t
   that stop WP Super Cache from working properly?
 *     ```
       # BEGIN WPSuperCache
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
       AddDefaultCharset UTF-8
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
       RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{HTTPS} on
       RewriteCond %{DOCUMENT_ROOT}/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
       RewriteRule ^(.*) "/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
       RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
       RewriteCond %{HTTP:Accept-Encoding} gzip
       RewriteCond %{HTTPS} !on
       RewriteCond %{DOCUMENT_ROOT}/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
       RewriteRule ^(.*) "/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
       RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
       RewriteCond %{HTTPS} on
       RewriteCond %{DOCUMENT_ROOT}/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
       RewriteRule ^(.*) "/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
   
       RewriteCond %{REQUEST_URI} !^.*[^/]$
       RewriteCond %{REQUEST_URI} !^.*//.*$
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{QUERY_STRING} !.*=.*
       RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
       RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
       RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
       RewriteCond %{HTTPS} !on
       RewriteCond %{DOCUMENT_ROOT}/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
       RewriteRule ^(.*) "/mnt/web7/a3/06/52371206/htdocs/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html" [L]
       </IfModule>
   
       # END WPSuperCache
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-mod_rewrite-rules-stop-gzip/#post-3103259)
 * Remove that “mod_gzip_on Yes” line in the .htaccess file and use the compression
   in the plugin as it’s better. It stores each cached page compressed already (
   and uncompressed for those clients that need it) so there’s no need to gzip the
   page each time. mod_gzip compresses each time wasting CPU on identical pages.
 *  Thread Starter [Simon_82](https://wordpress.org/support/users/simon_82/)
 * (@simon_82)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-mod_rewrite-rules-stop-gzip/#post-3103263)
 * Thank you so much for your reply, I appreciate it.
 * I deleted `mod_gzip_on Yes` from the htaccess file and tried to enable the compression
   in the plugin. The result: garbled text and weird characters all over the place.
   Need to hit refresh to load correctly. Something doesn’t add up here, trying 
   to find out more.
 * And, thanks again for your support.
 *  Thread Starter [Simon_82](https://wordpress.org/support/users/simon_82/)
 * (@simon_82)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-mod_rewrite-rules-stop-gzip/#post-3103264)
 * Others have had this problem before. My htaccess file doesn’t contain `mod_deflate`.
   And it seems `zlib output_compression` is on.
 *  [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-mod_rewrite-rules-stop-gzip/#post-3103300)
 * zlib output compression is probably set in your php.ini so you’ll have to be 
   root to change that, probably. If you can’t change it then you’re out of luck.
   You’ll have to disable compression in the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: WP Super Cache] mod_rewrite rules stop gzip’ is closed to new
replies.

## Tags

 * [gzip](https://wordpress.org/support/topic-tag/gzip/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [mod_rewrite](https://wordpress.org/support/topic-tag/mod_rewrite/)

 * 4 replies
 * 2 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-mod_rewrite-rules-stop-gzip/#post-3103300)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
