IIS 8.5 僞靜態去掉index.php thinkphp 3.2.2

由於測試都是在win下開發的 win8.1企業版php

II8.5 首先安裝  Thinkphp 3.2.2 web

URL Rewrite Module 2.0

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

上面地址選擇 合適的版本下載安裝測試

安裝完成後 關閉IIS 在從新打開網站

在你創建的網站根目錄有 web.config 這個文件url

輸入僞靜態規則spa

<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>

具體位置參考下個人.net

<?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>

而後訪問之前帶index.php/控制器/方法 的連接 去掉index.php看看code

這個index.php對於JS來講 很很差 用uploadify上傳後臺地址用U函數生成index.php就很很差  總出錯xml

其餘的一到後臺地址 有index.php老是出錯 

僞靜態規則仍是不懂 等先作出來慢慢研究下

相關文章
相關標籤/搜索