IIS伪静态去掉index.php thinkphp 3.2.2

因为测试都是在win下开发的 win8.1企业版

II8.5 首先安装  Thinkphp 3.2.2 

URL Rewrite Module 2.0

http://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads

上面地址选择 合适的版本下载安装

安装完成后 关闭IIS 在重新打开

在你建立的网站根目录有 web.config 这个文件

输入伪静态规则

复制代码
<rewrite>
 <rules>
 <rule name="OrgPage" stopProcessing="true">
 <match url="^(.*)$" />
 <conditions logicalGrouping="MatchAll">
 <add input="{HTTP_HOST}" pattern="^(.*)$" />
 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
 </conditions>
 <action type="Rewrite" url="index.php/{R:1}" />
 </rule>
 </rules>
 </rewrite>
复制代码

具体位置参考下我的

复制代码
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <add value="index.php" />
            </files>

        </defaultDocument>
         <rewrite>
             <rules>
             <rule name="OrgPage" stopProcessing="true">
             <match url="^(.*)$" />
             <conditions logicalGrouping="MatchAll">
             <add input="{HTTP_HOST}" pattern="^(.*)$" />
             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
             </conditions>
             <action type="Rewrite" url="index.php/{R:1}" />
             </rule>
             </rules>
             </rewrite>

    </system.webServer>


</configuration>
复制代码
posted @ 2018-02-02 12:37  finary  阅读(351)  评论(0)    收藏  举报