我想阻止文件config.json
访问,因此我将.htaccess
文件放置如下:
RewriteEngine on
RewriteRule config.json - [F]
在目录中,~/projects/bush
但是当我访问时localhost/projects/bush/config.json
仍然看到文件的内容,这有什么错?
检查Web服务器的配置(httpd.conf
),AllowOverride None
因为它禁止读取适用于其目录的.htaccess。通常这样做是为了提高性能。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句