2014-07-22 74 views
1

我使用的是PHP框架Codeigniter,我在其中放了一個codeigniter項目。我爲第一個寫了一個重定向URL,但我無法爲其他人編寫重定向URL,因爲ISS7允許一個web.config。現在我想從第二個中刪除index.php在IIS7中爲codeigniter重寫的規則

這個網址是

https://donate.nfppay.com/external/public_html/ 

的第一個項目的URL爲

https://donate.nfppay.com 

我的代碼編寫規則是:

<rule name="Main Rule" 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="external/public_html/index.php?/{R:1}" appendQueryString="false" /> 
</rule> 

回答

0

請創建新的web.config並在你的子目錄中放置第二個codeigniter。 首先刪除您之前添加的規則。

<remove name="previous rule name"/> 

,然後添加此規則

<rule name="Main Rule 2" 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" /> 
</rule>