Hello
Have you tried resetting the serving method as per this screenshot?
Thread Starter
lponce
(@lponce)
I have just tried to reset the serving method with no success.
When I am not logged in to the site the images shown are the jpeg and png files. But once I am logged in all the images are now in the webp format.
The htaccess file seems to activate the rewrite only when I am logged in.
Don’t understand what is going wrong ??
Thanks for your help
Hello,
If you have caching enabled, please clear it and re-test. If this does not work, please temporarily disable caching along with all other plugins apart from WP-Optimize and then re-test.
Thread Starter
lponce
(@lponce)
I have tested to clear, disable / enable your plugin. The same with the other plugins on my website, but there is no way to have it working correctly. What’s so frustrating is that all the webp files are on the server and just wait to be displayed.
Sorry about my previous message which was erroneous. When I am logged in the website does not deliver any webp files (it was my mistake, it was another server using another cache plugin).
What iI don’t get about your plugin is that your plugin doesn’t write any redirecting rule for webp files on the htaccess file. I had to find ones to put by hand in the htaccess. When I read my htaccess file there are many lines which come from your plugin. Why don’t you integrate webp redirecting rule ?
It’s really too bad because I really loved the approach of your plugin. I use a lot updraftplus backup plugin, and I felt at home with your wp-optimize plugin, everything was so easy and natural. I really would have loved to have it working and use it on all my websites.
Hope your next plugin version will better deal with webp files.
Hi,
The plugin uploads it to the uploads/.htaccess.
# BEGIN Register webp mime type
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
# END Register webp mime type
# BEGIN WP-Optimize WebP Rules
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect to existing converted image in same dir (if browser supports webp)
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} (?i)(.*)(\.jpe?g|\.png)$
RewriteCond %1%2\.webp -f
RewriteRule (?i)(.*)(\.jpe?g|\.png)$ %1%2\.webp [T=image/webp,E=EXISTING:1,E=ADDVARY:1,L]
# Make sure that browsers which does not support webp also gets the Vary:Accept header
# when requesting images that would be redirected to webp on browsers that does.
<IfModule mod_headers.c>
<FilesMatch "(?i)\.(jpe?g|png)$">
Header append "Vary" "Accept"
</FilesMatch>
</IfModule>
</IfModule>
# Rules for handling requests for webp images
# ---------------------------------------------
# Set Vary:Accept header if we came here by way of our redirect, which set the ADDVARY environment variable
# The purpose is to make proxies and CDNs aware that the response varies with the Accept header
<IfModule mod_headers.c>
<IfModule mod_setenvif.c>
# Apache appends "REDIRECT_" in front of the environment variables defined in mod_rewrite, but LiteSpeed does not
# So, the next lines are for Apache, in order to set environment variables without "REDIRECT_"
SetEnvIf REDIRECT_EXISTING 1 EXISTING=1
SetEnvIf REDIRECT_ADDVARY 1 ADDVARY=1
Header append "Vary" "Accept" env=ADDVARY
# Set X-WPO-WebP header for diagnose purposes
Header set "X-WPO-WebP" "Redirected directly to existing webp" env=EXISTING
</IfModule>
</IfModule>
# END WP-Optimize WebP Rules