title: Using php.ini, .htaccess and zlib.output to compress js, css and php files
body: <p>Ive been attempting to compress my website with gzip - although my server doesnt allow me do use mod_deflate, so ive found an alternative solution here: <a href="http://www.warpconduit.net/2010/10/23/enabling-gzip-compression-of-php-css-and-js-files-without-mod_deflate/" rel="nofollow">http://www.warpconduit.net/2010/10/23/enabling-gzip-compression-of-php-css-and-js-files-without-mod_deflate/</a></p>
  
  <p>It works wonders on the .php files in my root directory, I am wondering how I can integrate this into my js folders</p>
  
  <p>php.ini</p>
  
  <pre><code>output_handler = Off
  zlib.output_compression = On
  zlib.output_handler = ob_gzhandler
  </code></pre>
  
  <p>.htaccess</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteRule ^(.*\.js) gzip.php?type=js&amp;file=$1
  RewriteRule ^(.*\.css) gzip.php?type=css&amp;file=$1
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>The gzip.php file is located on link above...</p>
  
  <p>Will I have to add additional RewriteRule's for each folder that contains the .js files I would like to compress? For example:</p>
  
  <p>Add, RewriteRule ^(system\js.js) gzip.php?type=js&amp;file=$1</p>
  
  <p>Thanks for any help you can provide, Ive been trying to work this out the past couple of days finally feel like I am getting somewhere.</p>