This question already has an answer here:
I have a web application developed in PHP. My requirement is to block a folder which contains uploaded documents. For example, if a user click a document link on the application, it should open http://localhost:1987/enterprise_resource_planning/uploads/students/documents/1499866795_100_100.pdf if a user execute below url, it should block http://localhost:1987/enterprise_resource_planning/uploads/students/documents/ I've tried .htaccess with Deny from all, but it is blocking everything. Any solution for this senario ?
</div>
possible solutions:
Options -Indexes
personnally I prefer the 2nd line. There hardly ever is use for automatical listing of the files to a browsing visitor.