When I try redirect to another page with more than 1 parameter in querystring I get an error.

This works:

<rule name="t6" stopProcessing="true">
    <match url="^test.html$" />
    <action type="Redirect" url="mypage.aspx?param=1" redirectType="Permanent" />
</rule>

This doesn't work:

<rule name="t6" stopProcessing="true">
    <match url="^test.html$" />
    <action type="Redirect" url="mypage.aspx?param=1&param2=2" redirectType="Permanent" />
</rule>

Can you figure what's happening?

Thanks,

Armando

有帮助吗?

解决方案

replace instances of

&

with

&amp;

so your url parameter becomes

url="mypage.aspx?param=1&amp;param2=2"

this is an encoding requirement of xml.

ref: Which characters are Invalid (unless encoded) in an XML attribute?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top