title: htaccess rewrite rule for images to be served in webp from CDN
body: <p>Am serving my images from S3 bucket which has cname &quot;cdn&quot;</p>
  <p>I uploaded webp copy of my images and trying to rewrite the path with htaccess</p>
  <p>currently all my images are under the subdomain cdn.mydomain.com</p>
  <pre><code>    &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteCond %{HTTP_ACCEPT} image/webp
  RewriteCond %{HTTP_HOST} ^cdn.mydomain.com$/wp-content/uploads-webpc/$1.jpg.webp -f
  RewriteRule wp-content/uploads/(.+)\.jpg$ wp-content/uploads-webpc/$1.jpg.webp [T=image/w
  ebp]
  &lt;/IfModule&gt;
  </code></pre>