I want to redirect a SEO-Friendly outgoing link like example.com/out/productxyz with IIS 8.5. So I created a Rewrite-Rule with the Action-Type forward. The target URL has Parameters, e.g. example.com/action.aspx?param1=value&param2=value

The Problem is: When the IIS is saving the rule, the '&' chars from the parameters are converted to their HTML-Values:

<action type="Redirect" url="http://example.com/action.aspx?param1=value&amp;amp;param2=value" redirectType="Found" />

So a '&' is converted to '&amp;'. I took a look in the header and the IIS is exactly redirecting to 'http://example.com/action.aspx?param1=value&amp;param2=value'. This breaks because of the '&amp;' and so I get another side, and not the one which I would get with correct parameters.

I already tried to replace all '&amp;' to '&' in the web.config, but then I got an error in IIS that the config isn't a well-formed xml. So my question: How can I redirect a custom URL to a target URL with URL-Parameters, without broke the parameters?


the value in web.config should look like

<action type="Redirect" url="http://example.com/action.aspx?param1=value&amp;param2=value" redirectType="Found" />

not (notice the extra amp; you have here)

<action type="Redirect" url="http://example.com/action.aspx?param1=value&amp;amp;param2=value" redirectType="Found" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.