Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My test server will happily serve PHP pages if I navigate to them.

However, on one vhost, I have an index.php. This page will be served if I type in the URL. But, if I just type in 'http://mysite/', then the index.php will not be served.

I am running Apache 2.2 with the PHP module on Ubuntu.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You'll need to set the DirectoryIndex directive in your apache config.

Something like

DirectoryIndex index.php index.html index.htm

It can appear in either your server config, virtual host, directory, or an .htaccess file.

For full info: http://httpd.apache.org/docs/2.0/mod/mod_dir.html

share|improve this answer
    
Thanks Andrew. That did the trick. I placed that line near the top of the config file for my virtual host, and then restarted apache. Now the index.php page is visible straight away. –  robert Feb 15 '10 at 4:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.