How to Enable Compression via .htaccess

Please make sure to add the following code to your .htaccess file in order to enable GZIP compression.

The code below should be added to your .htaccess file...

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

  • 58 Users Found This Useful
Was this answer helpful?

Related Articles

Advanced Techniques: Avoid Down Time, Seamlessly Transfer Hosting With No Interruptions

Advanced Techniques We have also included some advanced tips below to supplement and expand upon...

How to Switch Hosts Without Having Any Down Time

Switching to a new host can be a complicated process. Follow our steps to ensure that your move...

Powered by WHMCompleteSolution