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