【问题标题】:Write rule for redirection in IIS7 for codeigniter在 IIS7 中为 codeigniter 编写重定向规则
【发布时间】:2014-07-22 15:25:34
【问题描述】:

我正在使用 PHP 框架 Codeigniter,并在其中放入了另一个 codeigniter 项目。我为第一个写了一个重定向 URL,但我不能为另一个写重定向 URL,因为ISS7 允许一次 web.config。现在我想从第二个中删除index.php

这个网址是

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

第一个项目的网址是

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>

【问题讨论】:

    标签: php codeigniter redirect iis-7


    【解决方案1】:

    请创建一个新的 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-07
      • 1970-01-01
      • 2016-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多