简体   繁体   中英

IIS Url Rewriter to detect feed and redirect to Feedburner

My site generates its rss feed in http://mysite.com/sydnication/rss/articles path. I want to redirect all users to feedburner when they access this url except for when feed burner's own user agent tries to access this url. This is the Url Rewrite rule that I thought should work, but it doesn't. Can some one take a look and tell me what's wrong?

<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>

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM