Forum Moderators: phranque
I need to be able to rewrite a URL containing an "encrypted" parameter and to decrypt it.
The URL would be something like:
[mysite.com...]
knowing that:
- the order of the parameters in the query string could change
- the parameter name "id" could change;
So I have to identify the parameter between the tags XX
Then I would have to rewrite the URL to;
[mysite.com...]
I can write the regular expression do "decrypt" the parameter from 24234234 to 95999934 but Im unable to find it and replace it using query_string. Any ideas?
Thank you!
RewriteCond %{QUERY_STRING} ^(([^&]*&)*[a-z]+)=XX([0-9]+)XX(&.*)?$
RewriteRule ^(.*)$ $1?%1=%3%4
In this specific case, a few retries may be necessary, but the 'boundaries' between name/value pairs are still well-defined, and the number of retries will be much smaller.
Jim