Skip to content

Instantly share code, notes, and snippets.

@steveh80
Created December 1, 2012 17:10
Show Gist options
  • Save steveh80/4183281 to your computer and use it in GitHub Desktop.
Save steveh80/4183281 to your computer and use it in GitHub Desktop.
Wie gzip-komprimierte Seiten (laut Support-Auskunft) via .htaccess bei 1&1 funktionieren sollen
<IfModule mod_rewrite.c>
# If the user agent accepts gzip encoding...
RewriteCond %{HTTP:Accept-Encoding} gzip
# ...and if gzip-encoded version of the requested file exists (<file>.gz)...
RewriteCond %{REQUEST_FILENAME}.gz -f
# ...then serve the gzip-encoded file. Done.
RewriteRule ^(.+)$ $1.gz [L]
# Or if the user agent accepts gzip encoding...
RewriteCond %{HTTP:Accept-Encoding} gzip
# ...and the requested file exists...
RewriteCond %{REQUEST_FILENAME} -f
# ...then use a PHP script serve a compressed version. Done.
RewriteRule \.(css|html|ico|js|json|txt|xml)$ /gz.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment