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

穿精又带淫゛_ 提交于 2019-12-07 01:12:02

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/16522057/how-to-set-web-config-default-page-for-php-index-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!