Ampersand URL Redirection with IIS 7 Rewrite Module

How can I use ampersand ( & ) in my rules for rewriting url in web.config file?

I want to rewrite the url:

 http://www.foo.com/index.asp?SomeParameter=SomeValue&SomeId=00 

in

 http://www.foo.com/Section/Page 

I wrote the following rule in my web.config:

  <rule name="RuleName" stopProcessing="true"> <match url="^index.asp?SomeParameter=SomeValue&SomeId=00" ignoreCase="true" /> <action type="Redirect" url="Section/Page" appendQueryString="false" /> </rule> 

But I am having problems with this ampersand ( & ) in the input url. When trying to rewrite I get:

The requested page is not available because the associated configuration data for the page is invalid.

I tried to parse the ampersand at %26 , but I am getting the same error.

+7
source share
1 answer

Try using the ampersand symbol code HTML &amp;

+9
source

All Articles