about 10 years ago
It's hard to believe in coincidence but the truth is that lot of developers including senior ones, don't know or bother about this security issue.
A lot of times we found that we can see list of all Images, CSS, JavaScript files hosted on server via hitting direct path of these assets folder. so to restrict user to access these files directly, you simply need to add this line (mentioned below) in your .htaccess file to hide the directory listing.
Options -Indexes -FollowSymLinks
Example
1. Create ".htaccess" file if not exist in your root directory.
2. Paste this code "Options -Indexes -FollowSymLinks" in your ".htaccess" file
3. Save the file.
Happy Coding!!
Can you help out the community by solving one of the following Javascript problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)