IIS7 Default Document not working

iis-7

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

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

What am I missing?

Best Answer

So you can call the file explicitly but when you just use the default address like 127.0.0.1 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.

Related Topic