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!!
0 Comment(s)