Created
December 9, 2018 19:06
-
-
Save landsman/41650b665bda507c3cacf8911de6e5ec to your computer and use it in GitHub Desktop.
webp pres htacesss - drupal coloseum
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 | |
# Check if browser support WebP images | |
RewriteCond %{HTTP_ACCEPT} image/webp | |
# Check if WebP replacement image exists | |
RewriteCond %{DOCUMENT_ROOT}/$1.$2.webp -f | |
# Serve WebP image instead | |
RewriteRule (.+)\.(jpe?g|png)$ $1.$2.webp [T=image/webp,E=accept:1] | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header append Vary Accept env=REDIRECT_accept | |
</IfModule> | |
AddType image/webp .webp |
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
https://www.drupal.org/project/webp | |
https://www.drupal.org/project/imageapi_optimize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment