Urlrewrite regex based on parameter
I would like to rewrite st开发者_开发知识库rings of this form:
"/folder/default.aspx?a=1&b=2&c=3" (example)
to
"/newfolder/?a=1&b=2&c=3"
if url contains "a=1
"
Im using UrlRewritingNet
Try this:
<rewrites>
<add name="SomeRuleNameHere"
virtualUrl="^~/folder/default\.aspx\?(.*&)?a=1(&.*)?$"
destinationUrl="~/newfolder/?$1a=1$2"
ignoreCase="true"
rewriteUrlParameter="ExcludeFromClientQueryString" />
</rewrites>
精彩评论