<Files "* .html"> doesn't match directory index?
I have this in my conf file:
<Files "*.html">
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R]
</Files>
The goal is that HTTPS is required to view any physical .html file. For application reasons, this must be a physical file; there are some urls that contain .html that rewrite app urls that don't require HTTPS. For this reason I am using a <Files>
URL based RewriteRule instead. Basically, what I need to check is not the physical name of the file, but the URL.
This works if the user visits example.com/index.html
or example.com/something/index.html
, but does not work if the user visits example.com/
or example.com/something/
, although in both cases it appears in the same index.hml file.
Based on the documentation for, <Files>
shouldn't this match based on the physical file name and not the url? Or is there any way to indicate this? Or is there another way I can do an equivalent redirect based on the physical filename?
source to share
No one has answered this question yet
Check out similar questions: