mat*_*kie 5 authentication apache-2.2
使用 Apache2,除了这些任何人都可以看到的特殊页面之外,我如何要求每个页面都有一个有效用户?
预先感谢您的想法。
根据评论更新;这是一个有效的 apache2 配置:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
Order allow,deny
allow from all
</Directory>
# require authentication for everything not specificly excepted
<Location / >
AuthType Basic
AuthName "whatever"
AuthUserFile /etc/apache2/htpasswd
Require valid-user
AllowOverride all
</Location>
# allow standard apache icons to be used without auth (e.g. MultiViews)
<Location /icons>
allow from all
Satisfy Any
</Location>
# anyone can see pages in this tree
<Location /special_public_pages>
allow from all
Satisfy Any
</Location>
Run Code Online (Sandbox Code Playgroud)
这应该有一个技巧:
<Location / >
AuthType Basic
AuthName "whatever"
AuthUserFile /etc/apache2/htpasswd
Require valid-user
AllowOverride all
</Location>
<Location /yourspecial>
allow from all
Satisfy Any
</Location>
Run Code Online (Sandbox Code Playgroud)
满足任何一个才是关键..
归档时间: |
|
查看次数: |
9894 次 |
最近记录: |