i.e. If you enter the image folder name with URL Link, it will display all the files inside that image folder.
http://websitename.com/images_folder or http://websitename.com/cssThrough the above example, anyone can display entire files on CSS or image folders.
How to prevent this?
By adding just two lines code in .htaccess file, we can prevent direct access of any folder.
Steps to deny direct access through .htaccess
1. Create .htaccess file on the website.
you just need to copy and paste the following simple code in your .htaccess file.
# directory browsing Options All -Indexes
2. Save it. This will never permit users to open files directly.
What is .htaccess?
Now the question is how we can block direct access to folders?
The exact answer is through .htaccess.
Do you think there are other concepts that I may include in this blog? Share with me through the comment box below !
I would love to hear from you
Also, don't forget to like this post and share it with your peers!