.htaccess 访问控制

发布于 2024-09-10 15:14:26 字数 238 浏览 0 评论 0原文

我有一个包含 htaccess 文件的目录:

AuthType Basic
AuthName "Go away"
AuthUserFile /home/daniel/.htpasswds/directory1/.htpasswd
Require valid-user

我在该文件夹中有一个子目录,我希望为其使用一组不同的用户名/密码。如何消除第一个 htaccess 的影响以便我可以使用身份验证?

谢谢

I have a directory which contains a htaccess file:

AuthType Basic
AuthName "Go away"
AuthUserFile /home/daniel/.htpasswds/directory1/.htpasswd
Require valid-user

I have a subdirectory within that folder that I wish to use a different set of usernames/passwords for. How do I negate the effects of the first htaccess so I can use the auth?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

娇纵 2024-09-17 15:14:26

只需将另一个 .htaccess 放入子文件夹中并覆盖其中所需的设置即可。

Just put another .htaccess in the subfolder and override the needed settings in there.

如果没结果 2024-09-17 15:14:26

默认情况下禁用使用其他 .htaccess。因此,您首先必须在 apache 配置文件的目录指令中设置“AllowOverride AuthConfig”。

To use another .htaccess is disabled by default. So you first have to set "AllowOverride AuthConfig" in the directory directive of your apache config file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文