Regarding Enable direct redirection to existing converted images
-
Hi,
When I Enable direct redirection to existing converted images then I come up with the message:
It seems your server setup does not support headers in .htaccess. You should either fix this (install mod_headers) or deactivate the “Enable direct redirection to existing converted images?” option. Otherwise the Vary:Accept header will not be added and this can result in problems for users behind proxy servers (ie used in larger companies)
However, my host has provided me rules to add to the .htaccess. What shall I do?
<IfModule mod_setenvif.c> # Vary: Accept for all the requests to jpeg and png SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image </IfModule> <IfModule mod_rewrite.c> RewriteEngine On # Check if browser supports WebP images RewriteCond %{HTTP_ACCEPT} image/webp # Check if WebP replacement image exists RewriteCond %{DOCUMENT_ROOT}/$1.webp -f # Serve WebP image instead RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp] </IfModule> <IfModule mod_headers.c> Header append Vary Accept env=REQUEST_image </IfModule> <IfModule mod_mime.c> AddType image/webp .webp </IfModule>
- The topic ‘Regarding Enable direct redirection to existing converted images’ is closed to new replies.