.htaccess 文件帮助
要进入我的网站,用户需要在弹出的 .htaccess 框中输入密码。我还想限制对 .svn 目录的访问。密码部分工作正常,但是当我添加最后一点关于阻止访问 .svn 下的任何内容时,我无法访问我网站上的任何页面:/
AuthUserFile /path/to/.htpasswd
AuthType Basic
AuthName "Development Area"
Require valid-user
<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>
To enter my site users are required to enter their password in the .htaccess box that pops up. I also want to restrict access to the .svn directory. The password part is working fine but when I add the last bit about blocking access to anything under .svn I'm unable to access any page on my site :/
AuthUserFile /path/to/.htpasswd
AuthType Basic
AuthName "Development Area"
Require valid-user
<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该可以正常工作。参数应该是目录名称匹配的正则表达式,并且在这种情况下不需要前后的通配符。另外,您的配置问题可能只是未引用正则表达式。
should work just fine. The argument should be a regex against which the directory name is matched and the wildcarded characters before and after shouldn't be necessary in this case. Also, the problem with your config is probably just that the regex wasn't quoted.