Support » Plugin: WebP Express » Can I make an exception for specific post/image?

  • Resolved dfnsk

    (@dfnsk)


    Hello! First of all, great plugin, thank you! Very easy to install. Works almost out of the box (at least on shared hosting).

    My question is can I make an exception and NOT convert images on specific post or just specific image? I understand that there is no settings for it, but I’m ok with the solution, where I shoud add some lines of code to .php files or make some changes to .htaccess?

    P. S. I’m making a post about art posters and for that kind of images webp is really contraindicated 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author rosell.dk

    (@roselldk)

    You could place something like this in wp-content/.htaccess, above the WebP Express rules to bypass webp redirections for all images in a folder:

    
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^uploads/2019/02 - [L]
    

    Or like this to bypass a specific files:

    
    RewriteRule ^uploads/2019/02/image1\.jpg - [L]
    RewriteRule ^uploads/2019/02/image2\.jpg - [L]
    
    • This reply was modified 4 months, 4 weeks ago by  rosell.dk.
    • This reply was modified 4 months, 4 weeks ago by  rosell.dk.
    Plugin Author rosell.dk

    (@roselldk)

    Getting a bit smarter, you can add the following before the WebP Express rules:

    
    RewriteCond %{QUERY_STRING} original
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule . - [L]
    

    This will pass through all requests that has the “original” in the querystring.
    So you can append “?original” the images which you want to bypass conversion.
    Ie img src=”wp-content/uploads/2019/02/image.jpg?original”

    • This reply was modified 4 months, 4 weeks ago by  rosell.dk.
    • This reply was modified 4 months, 4 weeks ago by  rosell.dk.
    • This reply was modified 4 months, 4 weeks ago by  rosell.dk.
    • This reply was modified 4 months, 4 weeks ago by  rosell.dk.

    Thank you so much!!!

    Aleksandr

    (@aleksandrx)

    Hello, could you give an example of the .htaccess file? I do everything according to your instructions, but exceptions do not work. Thank

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.