我明白我可以用下面的web.config代碼中刪除的URL「的index.php」部分:在IIS上刪除Codeigniter的index.php?
<rewrite>
<rules>
<rule name="Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
問題是我已經安裝在一個子目錄(mydomain.com/codeigniter)CI我無法理解web.config文件。
你知道如何改變它,因此它適用於子目錄嗎?
謝謝:)
您是否嘗試將子文件夾添加到重寫url路徑中? ' ' –
謝謝!這有效,但只有當我的第一條規則不存在時纔有效。實際上我需要兩個,一個用於頂層目錄,另一個用於子目錄。 – stuthemoo