Please wait while we load your page...


HTACCESS Magic :: Article :: Change Default Index Page

Results 1 to of

Change Default Index Page

This rule tells the server to search for and serve a file as the default directory index. This rule must exist in the htaccess files of the root directory for which you wish to replace the default index file. For example, let's say you want the default page in the 'welcome' directory to be welcome.html, such that when you call that directory alone (e.g.,, you will see the welcome.html page (instead of default index.html page). Here is the code:

DirectoryIndex welcome.html

This rule applies to the directory in which the .htaccess file exists, and all nested subdirectories. You can list multiple default files. The server will scan the root directory for the listed files, and serve the first match it encounters. The list is read from left to right:

DirectoryIndex welcome.html index.php default.htm

Last Revised: 2015-08-27

Live Chat Not Available