Aug 9, 2011
tom

How can I prevent people from looking at a listing of files in parent directory if I haven’t uploaded index.html?

Question

I haven’t uploaded index.html or index.php to my root directory. How can I prevent people from looking at a listing of files in parent directory?

http://oi56.tinypic.com/sc739e.jpg

Also, is it possible for people to obtain a list of all the files in the root directory once I upload index.html?

I’m currently using .htaccess and htusers to prompt someone to enter a username and password when they try to access any file in the root directory.

This may sound like a weird request but would it be possible to have them come to the site (without an index.html) and just have them not see the files? All it would say on the page would be the following:

Index of/

Apache Server at mysite.com Port 80

Answer

Use Options -Indexes to turn off auto-generation of indexes.

Related posts:

  1. Allow Directory Listing for SVN WebDav
  2. multiple levels of catch-all index.php in nginx
  3. Nginx requesting index through reverse-proxy
  4. How to use sed, perl to rename files and its contents with a particular pattern in a given directory?
  5. Prevent a program from deleting files in Windows?

Leave a comment