I want to block a file config.json from access, so I put .htaccess file like this:
RewriteEngine on
RewriteRule config.json - [F]
In directory ~/projects/bush but when I access localhost/projects/bush/config.json I still see the content of the file, what wrongs here?
AllowOverridemust be set to enable them at the directory level....should be escaped asconfig\.json- otherwise it matches any character so if you had a valid fileconfigxjsonthat would also be blocked by your rule. Just good practice.