apache2:除“special_page”之外的所有内容都需要有效用户

使用Apache2, 除了这些可以被任何人看到的特殊页面,我怎样才能要求每个页面都有一个有效的用户呢?

预先感谢您的想法。


更新回应评论; 这里是一个工作的Apache2configuration:

<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 (eg 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> 

这应该是一个窍门:

 <Location / > AuthType Basic AuthName "whatever" AuthUserFile /etc/apache2/htpasswd Require valid-user AllowOverride all </Location> <Location /yourspecial> allow from all Satisfy Any </Location> 

满足任何一个是严酷的