I'm trying to add webp support to mys ite but it seems that if my not webp file exists the .htaccess rule is being ignored.
System is
Using Nginx + apache / static files served through nginx but not images
This is my .htaccess part involved
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp]
Both thes files exists:
But according to the previous rule I should always seee the webp if my browser supports it.
The strange thing is that if I browse a rewrited url like this one:
Which is this physical url
https://www.magazzinirossi.it/img/p/6/7/9/0/7/67907-large_default.jpg
I see the webp image.
If I try the physical file directly it serves me the jpg instead of the webp although there is the rule in .htaccess.
Can anyone explain me how can this happen?
Thanks
System is
Using Nginx + apache / static files served through nginx but not images
This is my .htaccess part involved
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp]
Both thes files exists:
But according to the previous rule I should always seee the webp if my browser supports it.
The strange thing is that if I browse a rewrited url like this one:
Which is this physical url
https://www.magazzinirossi.it/img/p/6/7/9/0/7/67907-large_default.jpg
I see the webp image.
If I try the physical file directly it serves me the jpg instead of the webp although there is the rule in .htaccess.
Can anyone explain me how can this happen?
Thanks