我想要为除index.php
之外的所有文件使用auth这是我的代码,但我不知道出了什么问题......
AuthName "Restricted area"
AuthType Basic
AuthUserFile /var/www/.htpasswd
IndexIgnore */Network?Trash?Folder */Temporary?Items
Allow from 127.0.0.1
Allow from 192.168.0.254
Allow from ::1
Satisfy Any
<Files "*">
Require valid-user
</Files>
<Files "\index.php">
Order allow,deny
Allow from all
</Files>
答案 0 :(得分:1)
使用此
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/.htpasswd
<Files "*">
Require valid-user
</Files>
<Files "index.php">
Allow from all
Satisfy any
</Files>