2014-07-22 33 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>