Hello @mateuszgbiorczyk,
Thanks for your response.
Actually I followed all the steps in FAQ, I tried using both ngnix and apache for my website and it both scenarios I can’t get the redirects working via “via .htaccess (recommended)” option.
However if I change the setting to “Pass Thru (without rewrites in .htacces files or Nginx configuration)” I can see that my browser is fetching the webp format but then all the images in REST API responses are still jpg and png format.
I doubled checked the following files:
– /wp-content/.htaccess
– /wp-content/uploads/.htaccess
– /wp-content/uploads-webpc/.htaccess
and they are not empty:
# BEGIN WebP Converter
# ! --- DO NOT EDIT PREVIOUS LINE --- !
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/webp "access plus 1 year"
</IfModule>
# ! --- DO NOT EDIT NEXT LINE --- !
# END WebP Converter
also I have added following rule as an additional nginx directives :
location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ {
if ($http_accept !~* "image/webp") {
break;
}
add_header Vary Accept;
expires 365d;
try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404;
}
Also I tried serving assets files directly by nginx as well as apache.
so basically I tried pretty much all the scenarios but seems like something is not right on my VPS.