I want to enable webp support to speed up my website more (im using this too viewtopic.php?t=717 thx!)
At step 1 i need to select my webserver nginx or apache (what should i set?)
Then i choose apache then i have options automatic install or manual install, if i choose automatic then get error:
When i choose manually install then i have something like this:We tried different rules but your server still isn't serving WebP images. Please contact your hosting provider for further assistance. You can also see our troubleshooting guide or contact support for help.
When i put this code in /home/user/web/mywebsite.com/publuc_html and .htaccess i get infoCopy the generated code below and paste it at the top of your .htaccess file (before any existing code) in the root directory.
# BEGIN SMUSH-WEBP
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/wp-content/smush-webp/disable_smush_webp !-f
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/wp-content/smush-webp/$1.webp -f
RewriteRule wp-content/uploads/(.*\.(?:png|jpe?g))$ wp-content/smush-webp/$1.webp [NC,T=image/webp]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=WEBP_image
</IfModule>
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
# END SMUSH-WEBP
Next, click Check Status button below to see if it's working.
Troubleshooting
If .htaccess does not work, and you have access to vhosts.conf or httpd.conf, try this:
Look for your site in the file and find the line that starts with <Directory> - add the code above that line and into that section and save the file.
Reload Apache.
If you don't know where those files are, or you aren't able to reload Apache, you would need to consult with your hosting provider or a system administrator who has access to change the configuration of your server.
Still having trouble? Get Support.
when at first step i choose nginx they told me to putThe server rules have been applied but the server doesn't seem to be serving your images as WebP. We recommend contacting your hosting provider to learn more about the cause of this issue.
in server configuration so i adding this in server section in /home/user/conf/web/domain.com.nginx.conf and reload nginx then dont smush dont detect this change# BEGIN SMUSH-WEBP
location ~* "wp-content\/(uploads\/)(.*\.(?:png|jpe?g))" {
add_header Vary Accept;
set $image_path $2;
if (-f "/home/USER/web/domain.com/public_html/wp-content/smush-webp/disable_smush_webp") {
break;
}
if ($http_accept !~* "webp") {
break;
}
expires max;
try_files /wp-content/smush-webp/$image_path.webp $uri =404;
}
# END SMUSH-WEBP
is any possibility to enable webp on wordpress? thx