doesn't match directory index? I have this in my conf file: RewriteRule .* https://%{HTTP_HOST}%{REQUEST_U...">

<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?

+3
apache mod-rewrite


source to share


No one has answered this question yet

Check out similar questions:

2
Using RewriteRule makes the index file unreadable
1
Can't display images after using Apache RewiteEngine / .htaccess
1
Show 404 document with error for invalid urls from apache without applying rails
1
htaccess only redirects and does not rewrite
1
Multiple languages ​​+ htaccess
0
htaccess rewritecond doesn't work
0
Remove XForward-ssl from Vary header (Apache web server)
0
Http to https redirect for all posibilties to one url
0
Using mod-rewrite to conditionally select an existing file in a subdirectory based on the Host header?
0
Show content from different domain without changing url using .htaccess file



All Articles
Loading...
X
Show
Funny
Dev
Pics