how to set web.config default page for php index file

Pooya picture Pooya · May 13, 2013 · Viewed 23.9k times · Source

I'm trying to start my web site on iis server and I use php for that.

every thing is fine on server but defaultDocument.

how can I set that on web.config file.

  <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument enabled="true">
            <files>
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <add value="index.php" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

this is the default xml and I try other thing like:

<clear />

or try to remove other pages...

any Idea how can I set this file?

Answer

Pooya picture Pooya · Aug 7, 2013

after some more researches, the only suitable config was this...

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.html" />
                <add value="index.htm" />
            </files>
        </defaultDocument>
    </system.webServer>
    <system.data>
        <DbProviderFactories>
            <remove invariant="System.Data.SqlServerCe.4.0" />
            <add invariant="System.Data.SqlServerCe.4.0" name="Microsoft® SQL Server® Compact 4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </DbProviderFactories>
    </system.data>
</configuration>