RewriteEngine on
# Make sure the browser supports gzip encoding before we send it
RewriteCond %{HTTP:Accept-Encoding} b(x-)?gzipb
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L]
# without it, Content-Type will be "application/x-gzip"
# also add a content-encoding header to tell the browser to decompress
<FilesMatch .css.gz$>
ForceType text/css
Header set Content-Encoding gzip
</FilesMatch>
<FilesMatch .js.gz$>
ForceType text/javascript
Header set Content-Encoding gzip
</FilesMatch>
<FilesMatch .html.gz$>
ForceType text/html
Header set Content-Encoding gzip
</FilesMatch>