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.
|