thinkphp5在iis7下隐藏index.php

在根目录下创建 web.config 文件

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
        <rules>
            <rule name="OpenSourceBMS" patternSyntax="ECMAScript" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="true" negate="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="true" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="true" negate="true" />
                </conditions>
                <action type="Rewrite" url="index.php?s={R:1}" />
            </rule>
        </rules>
        </rewrite>
    </system.webServer>
</configuration>

 

posted @ 2018-02-28 09:32  chenjiacheng  阅读(198)  评论(0编辑  收藏  举报