url仅重写文件夹/ base

时间:2011-01-31 23:10:43

标签: iis-7 web-config url-rewriting

        <rule name="updates" stopProcessing="true">
            <match url="updates/" ignoreCase="true" />
            <action type="Rewrite" url="update.cfm" />
        </rule>

这样做没问题,除了updates/signin.cfm等更新下的任何页面都会重定向到update.cfm。如何仅在网址以updates/

结尾时才能应用它

1 个答案:

答案 0 :(得分:1)

URL Rewrite在其匹配表达式中使用RegEx,因此在匹配结束时,请确保将其描绘为“行尾”。我的正则表达式生锈了,但也许它的

“updates / $”?此外,您可能必须在比赛中逃离/。

http://www.regular-expressions.info/anchors.html