• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

How to prevent web users from being able to list the content of a directory?


I have a PHP application residing on a server. The PHP source files are stored in directories and sub directories. I would like to make sure that the web users CANNOT list the content of these directories containing the source files.

I saw some .htaccess files in the httpd.conf file. But I don't know how to use them, nor if they are the answer to my problem.

Any idea?


  • 2
1 Solution
Turn 'Indexes' option off -- server-wide or locally.  
(See description of 'Options' configuration file directive
for more information.)
stephaneeybertAuthor Commented:
You should post a comment instead of an answer, so that others would have the possibility to participate in this exchange of suggestions.

stephaneeybertAuthor Commented:
Have you a running example of your suggestion?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now