Support » Plugin: WebP Express » Load jpg or png when webp is not available

  • kuro

    (@marouane91)


    Hello,

    I just discovered your plugin today. I installed it, however from what i know webp is not supported in safari, so is there an option to load jpg or png when webp is not supported ?

    I have tried the following code in htaccess but it returned a 500 error

    Thank you for your help

    
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_ACCEPT} image/webp
        RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
        RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp
    [T=image/webp,E=accept:1]
    
    </IfModule>
    <IfModule mod_headers.c>
        Header append Vary Accept env=REDIRECT_accept
    </IfModule>
    AddType image/webp .webp
Viewing 2 replies - 1 through 2 (of 2 total)
  • In the “Alter HTML” section, use the option to replace tags with <picture> tags.

    Then both webp and normal jpg/png is served to the browser, and the browsers takes the format it likes the best 🙂

    Thread Starter kuro

    (@marouane91)

    Awesome man! Thank you very much 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Load jpg or png when webp is not available’ is closed to new replies.