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

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)

pQd*_*pQd 4

这应该有一个技巧:

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

满足任何一个才是关键..