0

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?

2

3 Answers 3

1

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.

1
  • Thanks, but this is exactly how I set it up but it is still not working. Feb 7, 2011 at 16:28
0

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .