我尝试使用 URL 重写 IIS 模块,以便将 url 修改为另一个 url,该参数包含在原始 url 的路径中。
Exp : 原始 URL : myurl/specialattribute_123456
想要的网址:myurl?specialattribute=123456
我使用了 URL 重写模块并在 web.config 中生成了这个标签:
<rewrite>
<rules>
<rule name="RedirectRule1" stopProcessing="true">
<match url=".*/specialattribute_(.*)/" />
<action type="Redirect" url="myurl?specialattribute={R:1}" />
</rule>
</rules>
<outboundRules>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
但它没有用......有什么帮助吗?