【问题标题】:iis url redirect not workingiis url重定向不起作用
【发布时间】:2011-03-23 16:05:33
【问题描述】:

嘿,我的重定向不起作用,我不明白为什么。 我的规则如下所示:

<rewrite>
        <rules>
            <rule name="rewrite to article" stopProcessing="false">
                <match url="^showfirm.asp\?rubrik=([_0-9a-z-]+)" />
                <action type="Redirect" url="esbjerg/sog/?q={R:1}&amp;t=" redirectType="Temporary" />
            </rule>
        </rules>
    </rewrite>

当我尝试将 url 与

匹配时
http://localhost/showfirm.asp?rubrik=sometexthere

我点击了我的自定义 404 页面,而不是点击

http://localhost/esbjerg/sog/?q=sometexthere&t=

谁能帮忙?我使用带有 urlrewriter 2.0 的 IIS 7.5

Ps : 第一次做 url 重定向 :)

【问题讨论】:

  • 您检查过定义规则的顺序吗?
  • 您是否尝试转义“showform.asp”中的点?我在regexpal.com 中尝试了正则表达式,没有转义它与目标句子不匹配。
  • @furquan 我不确定我在哪里可以检查这个,你在想我的 web.config 吗?因为我那里只有这条规则

标签: iis url-rewriting web-config


【解决方案1】:

试试这个:

<match url="^showfirm\.asp\?rubrik=([_0-9a-z-]+)" />

【讨论】:

  • 我只是尝试转义它并且它并没有改变任何东西,它确实应该被转义但是当我在 iss urlrewriter 中测试模式时它说它与 \. ://
猜你喜欢
  • 2015-01-29
  • 1970-01-01
  • 1970-01-01
  • 2013-02-27
  • 1970-01-01
  • 1970-01-01
  • 2014-08-30
  • 1970-01-01
相关资源
最近更新 更多