• Resolved LukeSeven

    (@lukeseven)


    Hi,

    I’d like to know what I am doing wrong but as I am unable to serve WebP images by using “Insert rewrite rules” button neither if I copy/paste the code into the htaccess file. Besides that all is working fine until I tick the “Alternative WebP Rewriting ” option. I am not currently using any CDN but I used to use CloudFlare in the past but I got into the same trouble. Basically what happens when I turn the “Alternative WebP Rewriting” option on, my VPS CPU wants to blow up. It goes to 100% until I disable this option. Can you please explain what I am doing wrong and what can be done from my side, please?

    https://www.ads-software.com/plugins/ewww-image-optimizer/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    Check out the WebP video on this page and see if it helps you get the .htaccess rules working. If your VPS doesn’t have both mod_rewrite and mod_headers enabled, then they just won’t work.

    The 100% CPU issue is a problem with the page parsing. Please post a link to your page, and I’ll take a look at that part of things.

    Thread Starter LukeSeven

    (@lukeseven)

    Hi and thanks for real quick response. I have watched your EWWW IO – WebP video for the second time and I must say that I am not sure if I am doing anything wrong but still cannot get it working on my WP multisite which is installed directly in the web root folder like /public_html/all wp files included .htaccess.

    If I use the button for inserting rewrite rules I get actually positive message like that:

    ” Rules verified successfully ”

    However, I cannot see the rewrite rule code in anywhere in the .htaccess file neither the webP image format when I inspect elements in Chrome Browser. Also the red Png image stays red.

    When I actually put the rewrite rule manually to my .htaccess file right above the # Begin WordPress thingy as you show in the video…
    I end up with the same results as above and the option for inserting rewrite rules reappears in the conversion settings again.

    Would you be that kind and have a look at it for me, please ? I am lost.

    this is the site marketonchart.com

    You might end up on my “maintenance” or “coming soon page” where I suppose… I should be getting webP images format in supported browsers too.

    By the way. I think your plugin rocks even if webP images are not being served but I know they are almost half of their size when they are served in webP format. This is absolutely “must have” thingy, you know.

    I will definitely appreciate your help.

    Let me know if you need to access my site as a Super Admin or even if you’ll need FTP access, and where you want me to send you the login credentials.

    Thank you in advance

    Plugin Author nosilver4u

    (@nosilver4u)

    When you added the .htaccess rules manually, did you put them ABOVE the standard WP rules?

    Thread Starter LukeSeven

    (@lukeseven)

    Hi, I am sorry I must have overlooked the email notification and I was wondering why you were not responding to my last message. Well, my bad. I am sorry I didn’t respond earlier. However, yes I have tried that too. I added the rules above the standard WP rules and also to the top but that makes no difference.

    Example :

    # 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

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    I still need your help

    Plugin Author nosilver4u

    (@nosilver4u)

    Ok, do you have them in the .htaccess file right now, above the WP rules?
    And can you provide a page that has an image with a webp alternative available?

    Thread Starter LukeSeven

    (@lukeseven)

    Well, yeah it’s still right above the WP rule now. However, I have put it to the top of the .htaccess file yesterday but it gets automatically overwritten by iThemes Security plugin. So it’s not in the top anymore but the EWWW rewrite rule is still above the WP one.

    I think you can pick any of my pages where you can find an image as all my images should be optimized already. So I guess you can try my home page https://marketonchart.com

    Plugin Author nosilver4u

    (@nosilver4u)

    Your server appears to be running nginx, a .htaccess file is doing nothing for you.

    Check these threads:

    https://www.ads-software.com/support/topic/webp-nginx-question?replies=3

    https://www.ads-software.com/support/topic/webp-not-working-on-nginx?replies=3

    Thread Starter LukeSeven

    (@lukeseven)

    You are right about the nginx and thank you for those threads you mentioned. I went through them quickly but I didn’t have much time to read it properly so I really didn’t get what I need to do in order to serve webP to supported browser while running nginx on my VPS.

    I’ve been very busy till today so I just at least found some time to replay to your latest message and I just wanted to thank you for those links.

    Cheers

    Thread Starter LukeSeven

    (@lukeseven)

    Hi,

    I know it’s been a while. I finally got time look into this deeper. I have read and tried all the suggested things from those articles and even read and used the code from GitHub but after making the last and the most important step regarding “try_files” I must do it wrong because I am unable to restart and then start up nginx at all.

    I found this great article here as I am going to try to deliver JXR images for edge browser too.

    This is what I have inserted at the end of my nginx.conf file and of course I have included jxr and webp inside Nginx’s mime.types

    image/vnd.ms-photo jxr wdp hdp;
    # image/jxr jxr wdp hdp; will break the negotiation in Edge 20.10240.16384.0

    here is what I have at the end of my nginx.conf file

    map $http_cookie $no_cache {
    default 0;
    ~SESS 1;
    ~wordpress_logged_in 1;
    }

    map $http_accept $img_suffix {
    “~*webp” “.webp”;
    “~*jxr” “.jxr”;
    }

    # Wildcard include
    include /etc/nginx/conf.d/*.conf;
    }

    However, as soon as I insert any piece of code like this behind it I am unable to restart/start my nginx server.

    # example location block only dealing with images with these extensions
    location ~* \.(?:png|jpe?g|gif|webp|jxr)$ {
    expires 1y;
    add_header Vary $vary_header;
    add_header Cache-Control $cache_control;
    # now serve our images
    try_files $uri$img_suffix $uri =404;
    }

    Would you be that kind and help me to figure this out, please ?

    It will be much appreciated.

    Thank you in advance

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