Reputation: 111
My directory tree:
/assets
/css
style.css
/js
script.js
I want to block all direcotries when I open url for example: http://example.com/assets, but I will must open http://example.com/assets/css/style.css
How can I solve this problem using .htaccess on apache server?
Upvotes: 0
Views: 60
Reputation: 5511
Add this to your .htaccess:
Options -Indexes
This will prevent directory browsing and return a 403 Forbidden status when browsing directly to directories.
Upvotes: 2