• Resolved Nathan

    (@natedanielz)


    Hi,

    Can you post the rules here so I can place them in my htaccess file? I can’t find the rules anywhere on your site.

    Also, where exactly do I place them?

    Thanks
    Nathan

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support adamewww

    (@adamewww)

    Hi Nathan,

    They would show up automatically in the plugin settings down where you activate WebP (as soon as you check WebP Conversion) and should have a button you can push that automatically enters them into your .htaccess rules. If it’s not there, you may want to uninstall/reinstall the plugin. It looks like this:

    https://prnt.sc/x2GNyROxkdJS

    Thread Starter Nathan

    (@natedanielz)

    If I reinstall it just shows the settings I already put in. and because the htaccess rules are nowhere to be found I would’ve liked to be able to copy them. But I guess I’ll just type everything over from your screenshot.

    Thanks
    Nathan

    Plugin Support adamewww

    (@adamewww)

    They may be different for your site, but here they are:

    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteCond %{HTTP_ACCEPT} image/webp
    	RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png|gif)$
    	RewriteCond %{REQUEST_FILENAME}\.webp -f
    	RewriteCond %{QUERY_STRING} !type=original
    	RewriteRule (.+)\.(jpe?g|png|gif)$ %{REQUEST_URI}.webp [T=image/webp,L]
    </IfModule>
    <IfModule mod_headers.c>
    	<FilesMatch "\.(jpe?g|png|gif)$">
    		Header append Vary Accept
    	</FilesMatch>
    </IfModule>
    AddType image/webp .webp
    Thread Starter Nathan

    (@natedanielz)

    Awesome, thanks!

    Hi,

    I’m new to WordPress. I built a site, after using PageSpeed Insight to test, I’m optimizing the site and also using ewww, WP Super Cache and Lazy Load.

    After optimizing with ewww I get the format in .jpg.webp or .png.webp …as in https://example.com/wp-content/uploads/2022/05/NewsBG-1536×864.jpg.webp or .png.webp

    Then I proceed to delete the cache as it’s not rendering the webp format. Now I’m stuck, trying to get the optimized images and also the correct rewrite that helps renders the webp version on the pages.

    Thanks for your help.

    • This reply was modified 1 year, 2 months ago by okiemutegold.
    Thread Starter Nathan

    (@natedanielz)

    Hi okiemutegold,

    I found that when you disable the webp option, save it and re-enable it again, you’ll get the htacces rules back which you can insert.

    Thank you Nathan. It worked.

    However, my main issue is getting it to render the webp image.

    Under Settings>EWWW>Webp Delivery Method, I get this message:

    In order to use server-based delivery, Cloudways sites must have WebP Redirection enabled in their Application Settings.

    WebP rules verified, but self-test failed: WebP response was too small

    But my support person says its a Custom PHP App, not a WordPress App

    Thanks.

    Thread Starter Nathan

    (@natedanielz)

    Hi,

    A simple google search would’ve done it 😉

    Go to step 2 in this cloudways doc: https://support.cloudways.com/en/articles/5799334-how-to-use-and-serve-webp-images-in-wordpress#h_0b5f5447f3

    I’ve gone through that article already.

    Thanks Nathan!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WebP .htaccess rules’ is closed to new replies.