thinkphp在iis7下隐藏index.php

浏览:1644 发布日期:2017/11/22 分类:技术分享 关键字: iis7 隐藏index.php thinkphp
在<system.webServer>里插入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>
最佳答案
评论( 相关
后面还有条评论,点击查看>>