WebP htaccess optimization

smenardpw Apr 19th, 2013 829 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Check if Accept header is image/webp, if an image is requested in "classic" folder with a classic format, and check if the corresponding webp image exists. If yes, rewrite the requested classic image URI to the WebP image URI.
  3. RewriteCond %{HTTP_ACCEPT} image/webp
  4. RewriteCond %{REQUEST_FILENAME} (.*)images/classic/(.*)\.(png|jpg|gif)$
  5. RewriteCond %1images/webp/%2\.webp -f
  6. RewriteRule .* images/webp/%2.webp [L]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand