You don't have to be registered to post questions in the support forum.
Click Here to start a new support topic.
Note that anonymous posts are screened for spam before they're visible to the public.

Webmaster Tools says gzip isn't enabled, but it is

Mon Mar 08, 2010 7:45 pm


If you're using Googles' Webmaster Tools and being told that you should enable gzip compression for your HTML files, even though you already have it enabled in the scripts management area and you're also seeing *.html.gz files in your html_cache folder, here's what to do.

Open the .htaccess file found in your html_cache folder in a text editor, or via SSH and something like nano. You should see something like this.

Code: Select all
<IfModule !deflate_module>
   <IfModule headers_module>
      <IfModule rewrite_module>
         <FilesMatch "\.html\.gz$">
            Header set Content-Encoding gzip
            AddType text/html gz
         </FilesMatch>
      
         RewriteEngine On
         RewriteCond %{HTTP:accept-encoding} gzip
         RewriteCond %{REQUEST_FILENAME}.gz -f
         RewriteRule \.html$ %{REQUEST_URI}.gz
      </IfModule>
   </IfModule>
</IfModule>


Replace that with the following.

Code: Select all
#<IfModule !deflate_module>
#   <IfModule headers_module>
#      <IfModule rewrite_module>
         <FilesMatch "\.html\.gz$">
            Header set Content-Encoding gzip
            AddType text/html gz
         </FilesMatch>
      
         RewriteEngine On
         RewriteCond %{HTTP:accept-encoding} gzip
         RewriteCond %{REQUEST_FILENAME}.gz -f
         RewriteRule \.html$ %{REQUEST_URI}.gz
#      </IfModule>
#   </IfModule>
#</IfModule>


Basically the default settings are careful not to double-encode files if your server has mod_deflate enabled. double-encoding will lead to seeing strange characters any time you access pages instead of the pages themselves, because technically the second encoding is re-encoding the already encoded binary data and the browser doesn't know this.

If you have further problems after commenting out these lines, you may be missing the mod_headers or mod_rewrite modules. Contact me and I'll help you get it squared away. :)
joebert
Developer
Developer
 
Posts: 53
Joined: Fri Feb 05, 2010 4:05 am
Location: Florida, USA