我有一个html登录页面,并且每次浏览器中直接访问html页面时,我想限制直接访问html页面或重定向到我的登录页面。 因此,我在.htaccess中使用了以下条目,但无法正常工作。我正在使用Apache 2.4.6
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?10.26.104.37 [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?10.26.104.37.*$ [NC]
RewriteRule \.(html)$ - [F]
<Directory "<doc path">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>