Article ID: 4193, created on Mar 24, 2008, last review on May 10, 2014

  • Applies to:
  • Sphera

Symptoms

Unable to brows VDS directory

Client using web browser to list VDS folders/files.
Index.htm is missing in web directory of the VDS accounts.

Resolution

The option for listing the directory is unsecured option; therefore the option is disabled on httpd.conf (apache configuration file) level.

I order to enable Directory Listing for some specific directory, use .htaccess file inside the directory with Options that will enable the Directory Listing for the directory.

The file ".htaccess" must be created in www directory as ASCII file with 644 permission .

If  you have a directory full of images or zips that you do not want people to be able to browse through? Typically a server is setup to prevent directory listing, but sometimes they are not. If not, become self-sufficient and fix it yourself:

IndexIgnore *

The * is a wildcard that matches all files, so if you stick that line into an htaccess file in your images directory, nothing in that directory will be allowed to be listed.

On the other hand, what if you did want the directory contents to be listed, but only if they were HTML pages and not images? Simple says I:

IndexIgnore *.gif *.jpg
 
And conversely, if your server is setup to prevent directory listing, but you want to list the directories by default, you could simply throw this into an htaccess file the directory you want displayed:
Options +Indexes

If you do use this option, be very careful that you do not put any unintentional or compromising files in this directory. And if you guessed it by the plus sign before Indexes, you can throw in a minus sign (Options -Indexes) to prevent directory listing entirely--this is typical of most server setups and is usually configured elsewhere in the apache server, but can be overridden through htaccess.

 

To get more detailed information please refer to http://httpd.apache.org/docs/howto/htaccess.html  .

5f478287f7e74fe9b07217d8131cd741 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF