Question

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

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top