Created
December 11, 2020 21:47
-
-
Save lukecav/597c9129851fc653b92c6e108145705a to your computer and use it in GitHub Desktop.
Smush Pro plugin WebP conversions rules for .htacess for Apache
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
# BEGIN SMUSH-WEBP | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{DOCUMENT_ROOT}/wp-content/smush-webp/disable_smush_webp !-f | |
RewriteCond %{HTTP_ACCEPT} image/webp | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteCond %{DOCUMENT_ROOT}/wp-content/smush-webp/$1.$2.webp -f | |
RewriteRule ^/?(.+)\.(jpe?g|png)$ /wp-content/smush-webp/$1.$2.webp [NC,T=image/webp,E=WEBP_image] | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header append Vary Accept env=WEBP_image | |
</IfModule> | |
<IfModule mod_mime.c> | |
AddType image/webp .webp | |
</IfModule> | |
# END SMUSH-WEBP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://premium.wpmudev.org/blog/local-webp-support-smush/
https://premium.wpmudev.org/blog/local-webp-support-smush/#apache
https://premium.wpmudev.org/docs/wpmu-dev-plugins/smush/#configurations