Eriyu

Registered
Apr 21, 2015
1
0
1
nah
cPanel Access Level
Website Owner
I'm having trouble getting Gzip to work on my site -- I enabled compression under "Optimize Website" and it worked at first, but I had to make changes to the .htaccess file, and even though I didn't touch the mod_deflate part and undid my changes when I realized I broke it, it's still not working: I have style.min.css and style.min.css.gz in the same directory, and the former works when I link to it but the latter doesn't.

What really confuses me is I've checked whether GZip is enabled on multiple sites (http://checkgzipcompression.com/ for example) and they all say it's working.

Just to make sure, this is what the .htaccess file looks like now:

Code:
<IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
    <IfModule mod_setenvif.c>
        # Netscape 4.x has some problems...
        BrowserMatch ^Mozilla/4 gzip-only-text/html
      
        # Netscape 4.06-4.08 have some more problems
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
      
        # MSIE masquerades as Netscape, but it is fine
        # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
      
        # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
        # the above regex won't work. You can use the following
        # workaround to get the desired effect:
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
      
        # Don't compress images
        SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>
  
    <IfModule mod_headers.c>
        # Make sure proxies don't deliver the wrong content
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
</IfModule>
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Have you tested with a different file to see if the issue persists with other compressed files?

Thank you.