I need to replace the values of the QueryString by using Apache mod_rewrite. Many values have to be replaced by one new value ({oldValueA1, oldValueA2} => newValueA; {oldValueB1, oldValueB2} => newValueB). The parameter appears variable times in the query_string. The order of the parameter values is random. If the redirected query_string contains a value twice, it doesn't matter for me. The request_uri is variable, but should not be change during the redirect.
Here are some examples. The first row contains the original url, the second the new one.
localhost/mag/cat/?myParameter=oldValueA1&myParameter=oldValueB1
localhost/mag/cat/?myParameter=newValueA&myParameter=newValueB
localhost/mag/?myParameter=oldValueA2
localhost/mag/?myParameter=newValueA
localhost/dig/cat/?myParameter=oldValueB1&myParameter=oldValueA2
localhost/dig/cat/?myParameter=newValueB&myParameter=newValueA
localhost/dig/?myParameter=oldValueB2&oldValueB3
localhost/dig/?myParameter=newValueB&newValueB
I tried several RewriteRules with some Conditions, but i can't find a solution for this problem. Has anyone an idea?
Thx! :)
&, not?