Reputation: 5803
I need to block access to a particular file (containing private data) in a directory using .htaccess. Is this possible?
We use Apache and nginx.
Upvotes: 0
Views: 333
Reputation: 1366
if you want to prevent viewing of a specific file, for example picture.jpg:
<files picture.jpg>
order allow,deny
deny from all
</files>
change picture.jpg with your file.
If you want to deny access to all files with .jpg extension:
<files ~ "\.jpg$">
Order allow,deny
Deny from all
</files>
Upvotes: 1
Reputation: 2221
<Files "yourfile">
Order allow,deny
Deny from all
Satisfy all
</Files>
See apache docs for more info...
Upvotes: 0