【问题标题】:IIS Url Rewriter to detect feed and redirect to FeedburnerIIS Url Rewriter 检测提要并重定向到 Feedburner
【发布时间】:2012-02-10 08:06:53
【问题描述】:

我的网站在http://mysite.com/sydnication/rss/articles 路径中生成它的RSS 提要。我想在所有用户访问此 url 时将所有用户重定向到 feedburner,除非 feed burner 自己的用户代理尝试访问此 url。这是我认为应该有效的 Url Rewrite 规则,但它没有。有人可以看看并告诉我出了什么问题吗?

<rule name="Feedburner redirection" enabled="true" stopProcessing="true">
    <match url="/syndication/rss/articles" />
    <action type="Redirect" url="http://feeds.feedburner.com/articles" appendQueryString="false" />
    <conditions logicalGrouping="MatchAll">
        <add input="{HTTP_USER_AGENT}" pattern="FeedBurner" negate="true" />
    </conditions>
</rule>

【问题讨论】:

    标签: asp.net asp.net-mvc iis iis-7.5


    【解决方案1】:

    尝试从匹配 url 中删除第一个正斜杠 (/),匹配的输入开头没有斜杠,以防万一我会添加 ignoreCase="true"

    <match url="syndication/rss/articles" ignoreCase="true" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-27
      • 2012-07-26
      • 2013-02-13
      • 1970-01-01
      • 1970-01-01
      • 2021-06-23
      • 1970-01-01
      • 2017-09-22
      相关资源
      最近更新 更多