【发布时间】:2013-08-21 00:42:57
【问题描述】:
我已经有一段时间不使用 UrlRewrite 插件中的 <rewrite> 规则了,这让我发疯...
我想要完成的是将用户重定向到:
http://portals.presentkorttorget.se/GetRelationPdf.ashx?relationId=904
发送给
http://www.presentkorttorget.se/GetRelationPdf.ashx?relationId=904
只有 portals 更改为 www,我试图避免在 .NET 中进行重定向,重新编译并发布整个网站。 p>
我试过的是:
<rewrite>
<rule name="PDF redirect to parent shop" patternSyntax="ECMAScript" stopProcessing="true">
<match url="portals\.(([a-z]+)\.([a-z]+))$/GetRelationPdf\.ashx\?$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="http://www.{R:1}/GetRelationPdf.ashx?{R:2}" />
</rule>
</rewrite>
以及我使用http://www.gskinner.com/RegExr/测试的正则表达式的一些变体
【问题讨论】:
标签: asp.net url-rewriting webforms