Information Systems



DirectoryIndex

DirectoryIndex on Apache.

I wanted to set my site up so index.php becomes the default page for a site instead of index.html. As is often with Apache, seemingly simple configuration settings involve multiple steps. The main setting is DirectoryIndex, but you also have to "allow" it through a directory option. The option is of course "Indexes" instead of "DirectoryIndex" which would seem more obvious.

The following works for me:

<VirtualHost *:80>
ServerName www.omnicode.com
DocumentRoot /home/mydir/sites/omnicode
ErrorLog logs/omnicode.com-error_log
<DIRECTORY /home/mydir/sites/omnicode/>
OPTIONS Indexes FollowSymLinks
AllowOverride All
</DIRECTORY>
DirectoryIndex index.php
</VirtualHost>