How do I make virtual host DirectoryIndex file appear in the url?

Posted by Bob Flemming on Server Fault See other posts from Server Fault or by Bob Flemming
Published on 2013-05-02T10:54:01Z Indexed on 2014/05/27 15:31 UTC
Read the original article Hit count: 195

I have setup a virtual host which specifies a default file to load when the URL is called.

The problem I have is that I need that default DirectoryIndex file to appear in the URL.

So when I go to: www.mysite.co.uk, I want www.mysite.co.uk/app.php to appear in the URL.

How can I achieve this using my virtual host configuration within my apache.conf file?

Here is my current code:

<VirtualHost *:80>
ServerName *.mysite.co.uk
DocumentRoot "/var/www/html/mysite/web/"
DirectoryIndex app.php
</VirtualHost>

© Server Fault or respective owner

Related posts about apache-2.2

Related posts about virtualhost