You can enable GZIP compression using two different Apache mods: mod_deflate and mod_gzip. Both allow compression from the server before files are sent to a browser. However, mod_deflate is recommended. It is more widely supported than mod_gzip. In addition, it is documented better and configured easily. If it’s dysfunctional, you can use mod_gzip. We have provided both Apache mods below for your reference.
Enable GZIP compression
Here's a detailed instruction to enable GZIP compression in the .htaccess file:
- Access the File Manager.
- Locate the public_html folder on the left menu panel. Select the folder of the domain name you wish to manage.
- Click the .htaccess file, then select Code Editor button at the upper part of the page.
You may also right-click .htaccess, then select Code Edit.
- Add one of the following scripts inside the .htaccess file:
Enable mod_deflate (recommended):
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
# For Olders Browsers Which Can't Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0 no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
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_exclude rspheader ^Content-Encoding:.*gzip.*
mod_gzip_item_exclude mime ^image/.*
- Click the Save Changes button at the upper right-hand corner.
Please let us know if you need any further assistance, or if you have any questions. We'd love to help!
Fantastic...Thank you for your feedback =)
Sorry... Please submit a support ticket or try another search.