4.4 Changing the Default Index Filename

If a document name is not specified in a URL, Apache looks for a specific filename such as index.html and returns it to the Web browser. The filename the Web Server looks for can be configured from the Document Preferences page under Content Management. If the specified filename cannot be found, the Web browser displays a listing of files and folders located at the URL.

By default, Apache defines index.html as the default home page filename, but you can set this to whatever filename you choose on the Document Preferences page.

Document Preferences page

If more than one name is specified, the server searches in the order in which the names appear in this field until one is found. For example, if your index filenames are index.html and home.html, the server first searches for index.html and, if it doesn't find it, the server then searches for home.html.

If Apache can't find a filename that matches the default index filename, and if the requested directory has directory indexing enabled (see Directory Indexing), Apache generates its own index file that lists the contents of the directory.

For example, a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.

Keep in mind that the default index file does not need to be relative to the directory. For example, any of the following would work:

Including three of these in order would cause the /cgi-bin/index.pl CGI script to be executed if neither index.html or index.txt existed in a directory.

To change the current default index filename:

  1. On the Document Preferences page, type a filename in the Index File Name field.

  2. Click Save > Save to save your changes.

    or

    Click Save > Save and Apply to save your changes and restart Apache so your changes are immediately put into effect.

    For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.

For more information, see the DirectoryIndex directive on the Apache Web site.