Change default document name


Is it possible to configure my web space so that the default document is different than index.html or index.php? If so, how do I go about doing this?

Thank you.


Use a DirectoryIndex directive in the .htaccess of the directory.

Here is the the documentation on the DirectoryIndex directive of mod_dir.

Example from the documentation:

More Dreamhost coupons


Lensman provided the authoritative resource, but you might be interested to know that there are several altenatives already recognized at DreamHost that will not require you to make any changes to your .htaccess file:

[quote]" The DirectoryIndex command lists all the files Apache should look for (in order) to determine what to display when somebody goes to a URL for a directory. That is, it’s the default file name for your web site. Ours is set to:

DirectoryIndex index.html index.shtml index.htm Index.html Index.htm Index.shtml default.htm Default.htm default.html Default.html default.shtml Default.shtml page1.html index.cgi index.php index.php3 index.phtml home.htm home.html home.shtml index.wml

As long as you name your “index” file any one of those things, it will work!

If you have two files with names from that list, Apache will show the one that shows up first (e.g. index.html will show up, even if you have an index.php file in the same directory).

You can change your own DirectoryIndex setting to be anything you’d like via an .htaccess file"[/quote]