其他分享
首页 > 其他分享> > htaccess基本身份验证只允许一个目录

htaccess基本身份验证只允许一个目录

作者:互联网

我正在使用Drupal 6.

我正在尝试使用htaccess基本身份验证来阻止对我的开发站点的访问.我已成功添加了auth,以便只有我们的开发人员才能访问它.

但是现在我要允许任何人访问一个模块(其链接以anon /开头).

例如:假设我的网站是testsite.com

我想阻止所有请求到testsite.com/anon/*的所有页面

可能吗?如果是,怎么办?

提前致谢.

解决方法:

编辑:第一个答复不起作用.方法如下:

请查看文档http://httpd.apache.org/docs/current/mod/core.html#require,上面写着:

<Directory /path/to/protected/>
  Require user david
</Directory>
<Directory /path/to/protected/unprotected>
  # All access controls and authentication are disabled
  # in this directory
  Satisfy Any
  Allow from all
</Directory>

这是针对Apache 2的.

标签:drupal-6,basic-authentication,php,htaccess
来源: https://codeday.me/bug/20191102/1993374.html