Indiana University
University Information Technology Services
  
What are archived documents?

For my web page, what is directory indexing, and how do I enable it?

Directory indexing is when a directory listing of files is displayed in a browser instead of an actual web page. This occurs when a URL resolves to a directory that does not contain a default file. The Webserve server at Indiana University looks for the following default files:

  • index.html
  • home.html
  • index.htm
  • home.htm
  • index.shtml
  • index.cgi
  • index.php4
  • index.phtml
  • index.php

Mercury, which serves Mypage pages at IU, looks for the following:

  • home.html
  • home.htm
  • home.shtml
  • index.html
  • index.htm
  • index.shtml

At IU, this feature has been disabled on Webserve and Mercury. If you do not have a default file in your www directory with one of the names listed above, visitors to your web page will receive a "403" or "Forbidden" error message.

The University Information Security Office considers disabling directory indexing on the web servers a prudent action to remove the possibility of unauthorized users discovering information about the file system that isn't specifically needed. Therefore, this feature will not be enabled by default, and individual account owners must assess whether this feature is appropriate for their web accounts.

To enable directory indexing

To enable directory indexing in your account, you need to create a file and save it as .htaccess . You can have additional information in this file, but to enable indexing you must have the following line:

Options Indexes

If the directory or subdirectory for which you wish to enable indexing contains files that use server-side includes (e.g., CGI, symlinks), you will need to add the following to the .htaccess file:

ExecCGI (for cgi files) IncludesNOEXEC (for server-side includes) SymLinksIfOwnerMatch (for symlinks)

For example, if you wish to enable directory indexing, and the directory or subdirectories therein contain cgi files and files using server-side includes, you would place the following line in your .htaccess file:

Options Indexes ExecCGI IncludesNOEXEC

Place the .htaccess file in the directory for which you would like to have directory indexing enabled. It is recursive, so any subdirectories therein will be enabled as well. For more information regarding .htaccess files, see the IU Webmaster document Controlling Web Page Access at:

http://webmaster.iu.edu/security_info/index.shtml
This is document amej in domain all.
Last modified on July 09, 2008.
Please tell us, did you find the answer to your question?