thinkphp5在iis7下隐藏index.php

在IIS的高版本下面可以配置web.config,在中间添加rewrite节点

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>  
            <rules>  
                <rule name="WPurls" enabled="true" stopProcessing="true">  
                    <match url=".*" />  
                    <conditions logicalGrouping="MatchAll">  
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />  
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />  
                    </conditions>  
                    <action type="Rewrite" url="index.php/{R:0}" />  
                </rule>  
            </rules>  
        </rewrite>

        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.html" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>
原文地址:https://www.cnblogs.com/chenjiacheng/p/8335513.html