How can I change the index listing in a directory? Print

  • 0

You can change the initial page that is sent to client requests when a directory is accessed by placing the following line into your .htaccess file in the document root of your account:

DirectoryIndex filename.ext

Replace "filename.ext" with the actual file you wish displayed when someone visits the directory where your .htaccess file exists. By default, the webserver will display a file named "index.php". If that does not exist, then it displays "index.html". If that does not exist, then it displays "index.htm" Finally, if that does not exist either it displays an error page, as we have Directory Indexing disabled by default and the server has exhausted all options of what to display.

If you wish to show a list (index) of files in a directory, please add this to your .htaccess file (on it's own line):

Options +Indexes

Was this answer helpful?

« Back