Home arrow FAQ arrow Web Hosting Technical arrow How to Display Directory Index Pages
Monday, February 06 2023
Main Menu
Contact Us
Copyright / DMCA
How to Display Directory Index Pages PDF Print E-mail

By default, a URL pointing to a directory, rather than a file, will return a "permission denied" error message. If you want to change this behaviour, there are two options.

One is to return a predefined "index page" which is an ordinary HTML, PHP script, text, or other document. When a directory path is requested, the web server looks for a few special filenames:

index.html index.html index.php index.php2

The files are looked for in this order, and the first one found is returned to the browser. If you would like to use a different file name for the index page, create a ".htaccess" file in the directory containing the page and include a line like:

DirectoryIndex default.html default.htm

This will cause the server to look for files named "default.htm" or "default.html" instead of the standard names. Any number of files may be listed.

The second option is to have the web server generate an index page automatically listing the contents of the directory. To enable automatic index pages, put a line like the following in a ".htaccess" file in the directory:

Options +Indexes

Remember that this will allow users to see all the file names in that directory, so make sure any private files have been protected appropriately.

HomeReliabilityNewsArticlesWeb LinksFAQPoliciesContact UsPrivacyCopyright / DMCA
Top of page

All logos and trademarks in this site are property of their respective owners.
All content is copyright © 2003-2005 Optimized Micro Devices LLC, except contributed items which remain the property of their authors.
Mambo is Free Software released under the GNU/GPL License and copyright © 2000-2005 Miro International Pty Ltd.