Last active
August 17, 2016 08:01
-
-
Save sergejmueller/5462544 to your computer and use it in GitHub Desktop.
Erweiterung der Apache-Systemdatei .htaccess für die Browser-abhängige Auslieferung von WebP- statt JPEG-Bilddateien. Speziell für WordPress. Mehr Informationen zu WebP und dem abgebildeten Snippet unter https://github.com/sergejmueller/sergejmueller.github.io/wiki/WebP:-JPEG-Nachfolger
This file contains 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> | |
RewriteEngine On | |
RewriteCond %{HTTP_ACCEPT} image/webp | |
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f | |
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1] | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header append Vary Accept env=REDIRECT_accept | |
</IfModule> | |
AddType image/webp .webp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment