Is it possible to have foo.com and www.foo.com resolve to index.html and admin.foo.com resolve to index.php? Both index.html and index.php reside in the same directory? I am tried the below configuration and all subdomains resolved to index.html.
<VirtualHost *:80>
ServerName foo.com
ServerAlias www.foo.com
DocumentRoot "/var/www/foo"
DirectoryIndex index.html
</VirtualHost>
<VirtualHost *:80>
ServerName admin.foo.com
DocumentRoot "/var/www/foo"
DirectoryIndex index.php
</VirtualHost>