允许 .htaccess 限制访问的目录中的某些子目录
使用 .htaccess 我对某些目录创建了身份验证限制,并且我只想允许访问其子目录之一。你能帮我如何实现这一目标吗?
tnx 在广告中!
更新:我当前的 .htaccess 包含以下内容:
AuthUserFile /var/www/mysite/httpdocs/passwds/.htpasswd
AuthGroupFile /dev/null
AuthName "In development..."
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
with .htaccess i created auth limitation on some directories, and i want to allow access to only one of their subdirectory. can you help me how to achieve that?
tnx in adv!
UPDATED: my current .htaccess contains next:
AuthUserFile /var/www/mysite/httpdocs/passwds/.htpasswd
AuthGroupFile /dev/null
AuthName "In development..."
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将 .htaccess 放入一个目录中,则该特定目录及其所有子目录将收到相同的策略。这意味着,如果您在任何子目录中放入另一个 .htaccess 文件,它可以修改任何先前定义的策略,与其父 .htaccess 相同。
将“满足任何”添加到子 .htaccess
请参阅apache“满足”文档< /a>,它应该有效,因为这是唯一的解决方案。
If you put .htaccess in one directory, that specific directory and all its children, receive same policy. That means, if you put in any children directory another .htaccess file, it can modify any previously defined policy, same as its parent .htaccess.
Add "Satisfy Any" to the child .htaccess
See apache "Satisfy" docs, it SHOULD work, as this is only solution.