0

This question already has an answer here:

I would like to remove or restrict access to someenter image description here phpbb directories

marked as duplicate by MrWhite, dan Jan 5 at 2:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

There are a couple of ways to accomplish this:

  1. Create a file called .htaccess and place it in your webroot if there is not one there already. Add this line to that file:

    Options -Indexes
    

    By placing it in your webroot it will prevent this from occurring in all sub directories thus preventing this from happening in your site. If you do want this behavior is some directories you will need to add this to the directories (or parent directories) you want affected.

  2. Put a blank index.html page or otherwise have some kind of index page in that directory. Apache wants to serve a default page (typically index.html, index.php) and when it cannot find one shows the directory contents.

Not the answer you're looking for? Browse other questions tagged or ask your own question.