Answer the question
In order to leave comments, you need to log in
Why don't .htaccess rules apply to static files?
Site on WordPress. I'm doing a test using the redbot.org service .
At the root, the .htaccess
line is written
Header set Cache-Control "max-age=31536000, public"
https://example.com/single-post
https://example.com/wp-content/uploads/2017/04/image.jpg
https://example.com/wp-content/uploads/2017/04/image.jpg
https://example.com/wp-content/uploads/2017/04/image.webp
.htaccess
indicated<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
https://example.com/wp-content/uploads/2017/04/image.webp
https://example.com/wp-content/uploads/2017/04/image.jpg
Answer the question
In order to leave comments, you need to log in
A possible option - your static is processed by nginx-catfish and it doesn't reach Apache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question