I have a website running on IIS 7 that has the default document on the Web Site Level set to only index.php. If I right click on the Web Site in IIS Manager and select Explore I see that the index.php file is there. If I just browse to the web site like http://my.site.com I get the default IIS 7 logo with "Welcome" in a bunch of diff languages. If I go to http://my.site.com/index.php it brings up the site just fine. I have stopped and started the Web Site and ran iisreset but still no luck.

The Default Document Section of Web.config looks like this

            <clear />
            <add value="index.php" />

What am I missing?


So you can call the file explicitly but when you just use the default address like it doesn't work? The first I would do is make sure the default document is also set to index.php. IIS7 will not do this even if you correctly set document handlers to recognize php(which it looks like you have if your index.php displays correctly).

Open the IIS7 control panel from the Computer Management panel. On the tab under Connections click Sites, the default web site. In the next panel to your right titled Default Web Site Home scroll down till you see Default Document and click on it. If it doesn't have index.php or whatever you want as your default file name then click on Add under Actions and type in the name you want to use. You may need to restart the service I am not sure. This should solve the problem, if you only want to do this for a single site under IIS then you can click on the individual site in the connections panel, then Default Document.

  • Thanks, but this is exactly how I set it up but it is still not working. – etoisarobot Feb 7 '11 at 16:28

Do a test with a page called default.aspx or default.htm and see if they still work as a default doc. If they do, then your hosting provider (I'm making an assumption) may be overriding the default documents.

Also make sure any of your own URL Rewrite rules at the site or global level aren't overriding your default docs.


This problem drove me crazy, have a solution that worked for me.

I had multiple websites running under IIS. Some of the websites worked fine with the default page, other threw an error.

What fixed it for me was looking at the ASP.net tab in the setup for each website. We don't run -any- .aspx pages but this tab holds the path for the web.config page for each website.

In my case, the websites that were not working had lost the 'ASP.net' version. By telling each website that I was running 4.0.x instead of this setting being blank, all the effected websites began working again. (As an FYI, we're running Coldfusion .cfm pages on the server).

This setting seems to hold a path to individual web.config files that store the default page. Even if you're not running .asp or .aspx pages, this setting is critical for your server finding the default page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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