change sequence of index files

General help with installation, scripts, etc....

change sequence of index files

Postby ernui » Mon Oct 01, 2007 4:20 pm

the system already set index.php, index.html as the default page when a visitor is visiting our websites, but there is a problem

how about if I have both index.html and index.php in same folder, and their names are not changable (other pages are relating to this name)

is that possible i can change which index page become my default page? thanks!
Posts: 1
Joined: Mon Oct 01, 2007 4:15 pm

Postby divya » Thu Oct 04, 2007 5:02 am


We can use the "DirectoryIndex" Apache configuration directive to set priority for the default pages as follows.

1. Open (create one if not present) the .htaccess file under the home directory [or the directory on which you wish to set priority]

2. You can use your own custom index files as follows.

DirectoryIndex index.html index.php

The server will work from left to right, checking to see if each file exists, if none of them exisit it will display a directory listing.

Now when a user access the website the webserver first looks for the index.html file, if it is not found there then it looks for index.php and so on.


Return to General Help

Who is online

Users browsing this forum: No registered users and 1 guest