Changing your Default Index with an .htaccess File

Article No. 64
Created: 01:09 AM 04.16.04
Author: Support
Original URL: http://myonlinehostingsupport.com/question.php?qstId=64


You can create a file called .htaccess in your public directory (www.mydomain.com). If you are already using an .htaccess file for website security, you should edit the existing file rather than creating a new one. Add the DirectoryIndex command AFTER the existing information, not before. The DirectoryIndex command in your .htaccess file should list the filenames that you would like a browser to look for in the order that you would like them to be used, separated by spaces. An actual command line might look something like this:

   DirectoryIndex index.html index.php3 default.htm default.html

In this case, a browser would look for an index.html file first, then index.php3, then default.htm, then default.html. This .htaccess file will be applied to every subdirectory of the directory it is placed in, so be sure to include any filenames that you are likely to use.

Back to original article