For enable Gzip compression using mod_deflate add following lines to your .htaccess file AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript But those who don’t allow the mod_deflate module and run PHP in CGI/FastCGI mode you can’t go with the easy method. So, to serve up your PHP, CSS, and JS files you can try the following method. Step 1: PHP Configuration Add or modify the following lines in your custom php.ini file output_handler = Off zlib.output_compression = On zlib.output_handler = ob_gzhandler Now this will take care of gzipping all PHP files. Step 2: .htaccess Configuration Add the following lines to the bottom of a .htaccess file in the root of your website. RewriteEngine On RewriteRule ^(.*\.js) gzip.php?type=js&file=$1 RewriteRule ^(.*\.css) gzip.php?type=css&file=$1 This will redirect all css and js requests files through gzip.p...