Enable GZIP Compression

To enable Gzip compression using mod_deflate on a website:

  1. SSH into the website you want to enable Gzip compression on.
  2. Open or create a .htaccess file in the top-level directory.
  3. Copy and paste the following code into the .htaccess file:
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/shtml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
  1. Save the file.

This will compress HTML, CSS, and JavaScript files using Gzip to improve website performance.

Was this answer helpful? 0 Users Found This Useful (0 Votes)