Created
December 1, 2012 17:10
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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