Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Gzip not working

Discussion in 'General Discussion' started by Eriyu, Apr 21, 2015.

  1. Eriyu

    Eriyu Registered

    Apr 21, 2015
    Likes Received:
    Trophy Points:
    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 ( for example) and they all say it's working.

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

    <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 mod_headers.c>
            # Make sure proxies don't deliver the wrong content
            Header append Vary User-Agent env=!dont-vary
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

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

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice