how to stop RedirectRule decode "%26" to "&"

Feb 25, 2010 at 1:11 AM

I am using the IIRF Rewriter Version 2.0. I don't know how to stop the RedirectRule to decode "%26" to "&".

I have the url with querystring, and I have the follwing code in .ini file

RewriteCond  %{HTTP_HOST}            ^www\.oldserver\.com$ [I,OR]
RewriteCond  %{HTTP_HOST}            ^oldserver\.com$ [I]

RewriteCond %{query_string} .
RedirectRule ^/firstpath/secondpath/testpage.aspx?(.*)$$1 [I,R=301]

It works fine if the original url have no "%26"in it, eg,   will be redirect to

But if the original URL have %26 in one of the parameter value of the querystring, eg, it will redirect to which causes my application to do wrong thing as it reads "title=maths" only.

So how can I write the RedirectRule to cater for both cases as above?