• Christian Zimpel

    (@christianzimpel)


    I Installed the Plugin and did try all diffrent Configurations but it is not working.

    I have no CDN and it is Apache server.

    I use Autooptimize could it be a problem here?

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

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

    (@roselldk)

    I see images pointing to cdn.shortpixel.ai. So you disabled WebP Express and went with another solution?

    Plugin Author rosell.dk

    (@roselldk)

    I haven’t tested with Autooptimize.

    Thread Starter Christian Zimpel

    (@christianzimpel)

    Hi I would prefeer your plugin instead of the shortpixel one.
    I switched now.
    Mybe you can help me to get it run.

    BR,
    Chris

    Plugin Author rosell.dk

    (@roselldk)

    Ok. Which mode have you selected?

    I can see that there is no redirection to the converter going on.
    And no HTML altering either

    • This reply was modified 6 years ago by rosell.dk.
    Plugin Author rosell.dk

    (@roselldk)

    If you have selected “Varied image responses”, some redirect rules should have been added in your wp-content/.htaccess. Does that file exist? If yes, please paste its content here

    Plugin Author rosell.dk

    (@roselldk)

    It might be that your Apache has been configured to disable .htaccess files. In that case, you need to copy the rules into your virtual host configuration (etc/apache/sites-available/your-site.com.conf)

    Plugin Author rosell.dk

    (@roselldk)

    It may also be that mod_rewrite isn’t enabled on your server.

    Thread Starter Christian Zimpel

    (@christianzimpel)

    Hi, It is the Varied image mode.

    I have the .htacces file in the Folder. Here is the Copy:

    # BEGIN WebP Express
    <IfModule mod_rewrite.c>
    RewriteEngine On

    # Redirect to existing converted image in cache-dir (if browser supports webp)
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{DOCUMENT_ROOT}/wp-content/webp-express/webp-images/doc-root/wp-content/$1.$2.webp -f
    RewriteRule ^/?(.+)\.(jpe?g|png)$ /wp-content/webp-express/webp-images/doc-root/wp-content/$1.$2.webp [NC,T=image/webp,E=EXISTING:1,L]

    # Set Cache-Control header so these direct redirections also get the header set
    <IfModule mod_headers.c>
    <FilesMatch “\.webp$”>
    Header set Cache-Control “private, max-age=31536000”
    </FilesMatch>
    </IfModule>

    # Pass REQUEST_FILENAME to webp-on-demand.php in request header
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^(.*)\.(jpe?g|png)$ – [E=REQFN:%{REQUEST_FILENAME}]
    <IfModule mod_headers.c>
    RequestHeader set REQFN “%{REQFN}e” env=REQFN
    </IfModule>

    # Redirect images to webp-on-demand.php (if browser supports webp)
    RewriteCond %{HTTP_ACCEPT} image/webp
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{QUERY_STRING} (.*)
    RewriteRule ^/?(.+)\.(jpe?g|png)$ /wp-content/plugins/webp-express/wod/webp-on-demand.php?wp-content=wp-content&%1 [NC,L]

    <IfModule mod_headers.c>
    <IfModule mod_setenvif.c>
    # Set Vary:Accept header for the image types handled by WebP Express.
    # The purpose is to make CDN aware that the response varies with the Accept header, so it should not just use the URL as cache key, but also the Accept header.
    SetEnvIf Request_URI “\.(jpe?g|png)” ADDVARY
    Header append “Vary” “Accept” env=ADDVARY

    # Set X-WebP-Express header for diagnose purposes
    # Apache appends “REDIRECT_” in front of the environment variables defined in mod_rewrite, but LiteSpeed does not.
    # So, the next line is for Apache, in order to set environment variables without “REDIRECT_”
    SetEnvIf REDIRECT_EXISTING 1 EXISTING=1
    Header set “X-WebP-Express” “Redirected directly to existing webp” env=EXISTING
    </IfModule>
    </IfModule>

    </IfModule>
    <IfModule mod_mime.c>
    AddType image/webp .webp
    </IfModule>

    # END WebP Express

    Plugin Author rosell.dk

    (@roselldk)

    Is there an .htaccess file in the uploads folder? (rules in there will override rules in wp-content/.htaccess)

    Plugin Author rosell.dk

    (@roselldk)

    Is autooptimize enabled? If yes, could you try to disable it for a moment and see if that solves it?

    Plugin Author rosell.dk

    (@roselldk)

    Could you temporarily create a file “server-info.php” file in your root with the following content: “<?php phpinfo(); ” ? (dont add the “)

    • This reply was modified 6 years ago by rosell.dk.
    Plugin Author rosell.dk

    (@roselldk)

    Can I also get the content of your .htaccess in root ?

    Thread Starter Christian Zimpel

    (@christianzimpel)

    OK there was a .ht file in uploads. I renamed it.
    the php info file is created.
    Chaching, Autooptimize everthing if off now.

    Plugin Author rosell.dk

    (@roselldk)

    I see that it works now.
    So question is which of your actions made it work.

    Plugin Author rosell.dk

    (@roselldk)

    Curious to know the content of .htaccess in uploads !
    My guess is that it an optimization created by Autooptimize to load images directly

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Not Working but Why?’ is closed to new replies.