I'm Using Managed Fusion URL Rewriter, so far it has been awesome. Now I just need to make sure a query string is passed in a URL from a proxy website. I Need to pass CODE=777 on every call so I have the code below:
RewriteRule ^(.*) http://www.somewebsite.com/$1?CODE=777[P, QSA,I,L]
However I need to strip the query string before hand. So I used the code below:
RewriteCond %{QUERY_STRING} ^CODE=([0-9]+)+$
RewriteRule ^(.*) http://www.somewebsite.com/$1? [P, QSA]
RewriteRule ^(.*) http://www.somewebsite.com/$1?CODE=777[P, QSA,I,L]
But it fails when I redirect with additional querystring such as below
http://proxyserver.com?othercode=something
Any Ideas how to strip a particular querystring without removing all query strings paramters?
I downloaded the source code from Managed Fusion and added the project to my solution.
I searched and found this bit of code below that appends the QueryString. I updated the code by adding a new method to remove the querystring CODE and affix a FIXED one.
I also added a Setting to control the FIXED Value assigned to the CODE.
ADDED NEW METHOD
With this modification. even if the user explictly types CODE=123 at the URL it will just be ignored and a fixed CODE value will be assigned