• Resolved ramonjosegn

    (@ramonjosegn)


    Hi dear

    How can I use webP images in my website?

    I am lookin for Apache rules but the link not working

    Thanks for support

Viewing 5 replies - 1 through 5 (of 5 total)
  • @ramonjosegn
    You could try.

    # BEGIN EWWWIO
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png)$
    RewriteCond %{REQUEST_FILENAME}.webp -f
    RewriteRule (.+)\.(jpe?g|png)$ %{REQUEST_FILENAME}.webp [T=image/webp,E=accept:1]
    </IfModule>
    <IfModule mod_headers.c>
    Header append Vary Accept env=REDIRECT_accept
    </IfModule>
    AddType image/webp .webp
    # END EWWWIO

    https://ww.wp.xz.cn/support/topic/alternative-webp-rewriting/

    • This reply was modified 9 years, 8 months ago by Luke Cavanagh. Reason: clarify wording
    Thread Starter ramonjosegn

    (@ramonjosegn)

    Ok, thanks

    Thread Starter ramonjosegn

    (@ramonjosegn)

    I think should be interesting a aditional plugin with code for <picture> element, maybe

    <a target="_blank" href="http://webimagen/miimagen.webp">
    <picture>
      <source srcset="http://mywebsite/maparuta4.webp" type="image/webp">
      <!-- fallback for browsers without support -->
    <img src="http://http://mywebsite/maparuta4.jpg" alt="Alt text">
    
    </picture>
    </a>

    Thanks for the answer

    Plugin Author Shane Bishop

    (@nosilver4u)

    @ramonjosegn, already on the roadmap 🙂

    Thread Starter ramonjosegn

    (@ramonjosegn)

    Thanks, should be great

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WebP rules not working (link dead)’ is closed to new replies.