Category: Apache

Apr 9 2008

serve .html then .php

Firstly, why?...well, there could be any number of reasons really, I was just developing an application on a server and didn't want its index to be the default public facing file until I'd configured it a bit, I knew that the code I was working on required an index.php file to be uploaded and I also knew (by way of a little test) that apache would serve that first so I got to digging about for the correct apache config option to serve index.html until I was ready for index.php to be default. (incidently, this of course, applies to any file extension you happen to be using, like .cfm for example)

Firstly I headed directly into httpd.conf to locate the DirectoryIndex option and discovered that the order was correct for what i required...ie index.html was to be served before index.php....but I knew that it wasn't so what was going on?...well, in short I don't know...maybe someone can explain it here? The workaround I discovered was to create a .htaccess file for the domain in question and simply add the following:

DirectoryIndex index.html index.php

job done...

2 comments - Posted by mark at 1:48 PM - Categories: Apache