DirectoryIndex

daveyw

Verified User
Joined
Jan 5, 2008
Messages
668
Location
/dev/null
Hello,

First of all i've searched on google and this forum and didn't found the solution.

We have the line below in our httpd.conf (everyone of you)
DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
I should think that index.html will be first, index.htm second and then index.shtml and then index.php etc..

But for some reason is index.php overruling the index.html.
My question: I want first index.html, after that index.php instead of index.php then index.html.

How can I fix this?
 
Whichever is listed first will be the default. You must have something somewhere else causing the issue.
 
Apache understands the last DirectoryIndex line it finds in your context. So if you've got a user-specific httpd.conf file with a different line, or even an include file later in the main httpd.conf file, with a different line, the last one apache reads is the one it'll use.

Check also check for the line .htaccess file; it's read last. Then in the last such line, the first filename will be found first, then the second, and so on.

Jeff
 
Back
Top