Skip to content

Instantly share code, notes, and snippets.

@yut148
Created March 6, 2013 10:03
Show Gist options
  • Save yut148/5098241 to your computer and use it in GitHub Desktop.
Save yut148/5098241 to your computer and use it in GitHub Desktop.
apache css etc. gzip configuration example
<Directory "/var/www/html">
RewriteEngine on
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME} !\.gz$
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule .+ %{REQUEST_URI}.gz
<files *.html.gz>
AddType "text/html;charset=utf-8" .gz
</files>
<files *.js.gz>
AddType "text/javascript;charset=utf-8" .gz
</files>
<files *.css.gz>
AddType "text/css" .gz
</files>
AddEncoding x-gzip .gz
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment