htaccess RewriteRule 阻止 php/html,允许所有其他...?
如何为 htaccess 编写 RewriteRule 以阻止对 php/html 的访问(除非经过身份验证)并允许访问所有其他扩展?
How do I write a RewriteRule for htaccess to block access to php/html (unless authenticated) and allow access to all other extensions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够将标准 .htpassword auth 放入 filesmatch 属性中...
所以...
这应该会导致对 .html 或 .php 的任何请求要求输入密码,您必须生成有效的 .htpasswd 文件...
You should be able to put a standard .htpassword auth inside a filesmatch attribute...
So...
That should cause any request to .html or .php to ask for a password, you must generate a valid .htpasswd file...