• Hi,

    I think you’ve not gotten notifications of replies I created in this thread.

    So I would like to draw your attention again.

    I’ve mod_header enabled and the plugin is still complaining about the absence of mod_header after enabling direct redirection option.

    Below is the code, I have added before htaccess rules created by the plugin:

    <IfModule mod_headers.c>
        Header set Content-Security-Policy "default-src 'self' *.facebook.com;frame-ancestors 'self' *.facebook.com;script-src 'strict-dynamic' 'nonce-rAnd0m123' 'unsafe-inline' http: https:;base-uri 'none';object-src 'none';"
    </IfModule>
    
    # BEGIN WebP Express
    # The rules below are a result of the WebP Express options, WordPress configuration and the following .htaccess capability tests:
    # - mod_header working?: no
    # - pass variable from .htaccess to script through header working?: no
    # - pass variable from .htaccess to script through environment variable working?: yes
    <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]
    
      # WebP Realizer: Redirect non-existing webp images to webp-realizer.php, which will locate corresponding jpg/png, convert it, and deliver the webp (if possible) 
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^/?(.+)\.(webp)$ /wp-content/plugins/webp-express/wod/webp-realizer.php [E=DESTINATIONREL:wp-content/$0,E=WPCONTENT:wp-content,NC,L]
    
      # 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?%1 [E=REQFN:%{REQUEST_FILENAME},E=WPCONTENT:wp-content,NC,L]
    
    </IfModule>
    <IfModule mod_mime.c>
      AddType image/webp .webp
    </IfModule>
    
    # END WebP Express

    You can verify the existence of Content-Security-Policy header by visiting the URL provided. How do I enable direct redirection?

    For more details, please visit the thread link.

    Thanks

    • This topic was modified 6 years, 9 months ago by Amit Sonkhiya.

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

The topic ‘mod_header Installed Still the Plugin is Complaining’ is closed to new replies.