Precise Future

Rewrite rules for EWWW Image Optimizer

EWWW Image optimizer It is one of the plugins we have worked with that is the most suitable for our hosting stack, cloud and plugins used in the sites we work with.

However, we can't get the rewrite rules to get pushed properly into our stack and once you try to push them from the plugin settings it's not easy to find again. That's why we leave them here

RewriteEngine On RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png|gif)$ RewriteCond %{REQUEST_FILENAME}\.webp -f RewriteCond %{QUERY_STRING } !type=original RewriteRule (.+)\.(jpe?g|png|gif)$ %{REQUEST_URI}.webp [T=image/webp,L] Header append Vary Accept AddType image/webp .webp

In our case it is not a problem since even in the free version of the plugin if you deliver your content through a CDN (in our case AWS CloudFront), it allows rewriting using javascript.

Share:

Related Posts

en_US