• Resolved mozza6001

    (@mozza6001)


    Hello,

    I use the rewrite mode to have my jpg|png|gif etc…. images loaded in webp.

    Unfortunately when I go to network and inspect the page I can see that it doesn’t work and the images are still loaded in their original format.

    I don’t use a CDN and the webp images exist.

    Here’s what’s been added to the htaccess :

    # BEGIN Imagify: rewrite rules for avif
    <IfModule mod_setenvif.c>
    	# Vary: Accept for all the requests to jpeg, png, and gif.
    	SetEnvIf Request_URI "\.(jpg|jpeg|jpe|png|gif|webp)$" REQUEST_image
    </IfModule>
    
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    
    	# Check if browser supports AVIF images.
    	# Update the MIME type accordingly.
    	RewriteCond %{HTTP_ACCEPT} image/avif
    
    	# Check if AVIF replacement image exists.
    	RewriteCond %{REQUEST_FILENAME}.avif -f
    
    	# Serve AVIF image instead.
    	RewriteRule (.+)\.(jpg|jpeg|jpe|png|gif|webp)$ $1.$2.avif [T=image/avif,NC]
    </IfModule>
    
    <IfModule mod_headers.c>
    	# Update the MIME type accordingly.
    	Header append Vary Accept env=REQUEST_image
    </IfModule>
    # END Imagify: rewrite rules for avif
    
    # BEGIN Imagify: rewrite rules for webp
    <IfModule mod_setenvif.c>
    	# Vary: Accept for all the requests to jpeg, png, and gif.
    	SetEnvIf Request_URI "\.(jpg|jpeg|jpe|png|gif)$" REQUEST_image
    </IfModule>
    
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    
    	# Check if browser supports WebP images.
    	RewriteCond %{HTTP_ACCEPT} image/webp
    
    	# Check if WebP replacement image exists.
    	RewriteCond %{REQUEST_FILENAME}.webp -f
    
    	# Serve WebP image instead.
    	RewriteRule (.+)\.(jpg|jpeg|jpe|png|gif)$ $1.$2.webp [T=image/webp,NC]
    </IfModule>
    
    <IfModule mod_headers.c>
    	Header append Vary Accept env=REQUEST_image
    </IfModule>
    # END Imagify: rewrite rules for webp

    Can you tell me what’s wrong?

    Thanks in advance, I’ve tried everything.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WP Media

    (@wp_media)

    Hi @mozza6001

    Can you please make sure that mod_rewrite is turned on on the server level?

    Best Regards,

    Ioanna

    Thread Starter mozza6001

    (@mozza6001)

    I made a ticket to the host (planethoster) they told me that the mod_rewrite is enabled.

    And the server type is LiteSpeed

    • This reply was modified 11 months ago by mozza6001.
    Thread Starter mozza6001

    (@mozza6001)

    any help ?

    Thread Starter mozza6001

    (@mozza6001)

    Plugin Author WP Media

    (@wp_media)

    Hi @mozza6001

    Thanks for your patience!

    Based on all this info, it should work fine, but it does not for some reason. It might be best to try with alternative plugins such as WebP Express and see if it would deliver the next-gen version. If so, that would require a detailed investigation from our end and we would have to know more details about your setup (other plugins you use for example).

    Best Regards
    Marko

    Plugin Author WP Media

    (@wp_media)

    Hi @mozza6001

    I’m following up to see if I left any of your questions about Imagify unanswered? 
    If all is well, there’s no need to reply, and I will just close our conversation.

    However, if you have any further questions about Imagify, feel free to let me know, I’ll gladly continue to assist you.

    Thanks!
    Marko
    ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Rewrite image to webP not working’ is closed to new replies.