当我尝试重定向到查询字符串中包含多个参数的另一个页面时,我收到错误。
这有效:
<rule name="t6" stopProcessing="true">
<match url="^test.html$" />
<action type="Redirect" url="mypage.aspx?param=1" redirectType="Permanent" />
</rule>
这不起作用:
<rule name="t6" stopProcessing="true">
<match url="^test.html$" />
<action type="Redirect" url="mypage.aspx?param=1¶m2=2" redirectType="Permanent" />
</rule>
你能算出发生了什么吗?
谢谢,
阿曼
答案 0 :(得分:3)
替换
的实例&
与
&
所以您的网址参数变为
url="mypage.aspx?param=1&param2=2"
这是xml的编码要求。
参考:Which characters are Invalid (unless encoded) in an XML attribute?