+ -
当前位置:首页 → 问答吧 → 怎么在指定的网站目录加上认证(auth)

怎么在指定的网站目录加上认证(auth)

时间:2009-11-18

来源:互联网

如何让指定的目录加上auth认证.

我的站用了rewrite功能, 访问时为
http://host/                -> /webiste/  (物理路径)
http://host/admin        -> /webiste/module/admin

在.conf加入下面的代码后,打开 http://host/ 会跳出认证框
<Directory "/webiste/">
AuthType Basic
Allow from all
AuthName "admin login"
AuthUserFile /webiste/passwd
require valid-user
</Directory>

但我现在想在访问 http://host/admin 加上认证.
但.conf 的Directory怎么写都不行(/webiste/admin,/webiste/module/admin/都不行),
请问要怎么写,请知道的朋友指教一下~~

作者: smallipis   发布时间: 2009-11-18

已解决,原来有这个locationmatch....
<LocationMatch "/admin">
AuthType Basic
Allow from all
AuthName "admin login"
AuthUserFile /website/passwd
require valid-user
</LocationMatch>

作者: smallipis   发布时间: 2009-11-18

热门下载

更多