Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a web developer and I've requested our Sys-Admin to setup a server for my team that will be used as a development environment.

The PHP is running as a CGI. When i try to open http://myaddress/ I receive 403 Forbidden. When I try to open http://myaddress/index.php everything is fine.

How do I set the server to look for index.php file by default?

P.S The sysadmin is not currently here, so he cannot do it for me.

share|improve this question
up vote 2 down vote accepted

Or put it into /etc/apache2/httpd.conf somewhere, but remember to comment old directive (i.e. index.html). On Windows file is located somewhere else.

share|improve this answer
It will be globally set. – DSkowronski Jul 4 '12 at 9:20

Use the DirectoryIndex directive:

DirectoryIndex index.php

Here's more info on how to use DirectoryIndex.

share|improve this answer

If you use Apache and have no access to it's configuration you can place .htaccess file inside web site folder.

Just put following content in file .htaccess:

DirectoryIndex index.php
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.