/ Published in: Apache
Combine this with the my compression script and things load real fast. I think I pulled some of this code of a site on google... can't claim complete credit.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# no weird non-ASCII quotes! Arg! They wasted an hour of time! # info: http://www.bluehostforum.com/showthread.php?t=11402 Options +followsymlinks <FilesMatch "\.js.gz$"> ForceType text/javascript Header set Content-Encoding: gzip </FilesMatch> <FilesMatch "\.js$"> RewriteEngine On RewriteCond %{HTTP_USER_AGENT} !".*Safari.*" RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule (.*)\.js$ $1\.js.gz [L] ForceType text/javascript </FilesMatch> <FilesMatch "\.css.gz$"> ForceType text/css Header set Content-Encoding: gzip </FilesMatch> <FilesMatch "\.css$"> RewriteEngine On RewriteCond %{HTTP_USER_AGENT} !".*Safari.*" RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule (.*)\.css$ $1.css.gz [L] ForceType text/css </FilesMatch>