【问题标题】:Simple IIS url rewrite not working简单的 IIS url 重写不起作用
【发布时间】:2014-02-16 12:24:47
【问题描述】:

我试图隐藏我安装框架的子目录。虽然这在 .htaccess 中就像一个魅力,但我被 IIS 规则困住了。基本上我想从 http://www.mysite.com/CI/client-trackinghttp://www.mysite.com/client-tracking

我正在使用这条规则

<rule name="Redirect to Codeigniter" stopProcessing="true">
    <match url="^client-tracking$" ignoreCase="false" />
    <action type="Rewrite" url="/CI/client-tracking"  />
</rule>

LE:我不需要重定向,我需要重写 URL 并从中删除 \CI 目录,以便用户和搜索引擎看到一个不错的链接。

【问题讨论】:

    标签: .htaccess iis mod-rewrite


    【解决方案1】:

    你有没有试过去掉重写后的url前面的“/”

    <rule name="Redirect to Codeigniter" stopProcessing="true">
        <match url="^client-tracking$" ignoreCase="false" />
        <action type="Rewrite" url="CI/client-tracking"  />
    </rule>
    

    【讨论】:

      猜你喜欢
      • 2014-08-02
      • 2016-11-17
      • 2016-02-25
      • 1970-01-01
      • 2011-12-12
      • 2013-08-14
      • 2013-07-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多