I'm writing an apache 2.4 Rewrite rule in order to remove a query string param and create a cookie from its value.
eg:
http://example.com/?param1=value1&my_param=my_value¶m2=value2
to
http://example.com/?param1=value1¶m2=value2
i'm successfully using apache RewriteRule to set a cookie but i would like to set the prepended query string param value as cookie value.
if i remove my_param=my_value from the query string
i want the value of the cookie to be my_value
this is what i've done so far, the only problem is that i can't figure out out to retrieve "my_value".
RewriteCond %{QUERY_STRING} (.*)(?:^|&)utm_source=(?:[^&]*)((?:&|$).*)
RewriteCond %1%2 (^|&)([^&].*|$)
RewriteRule ^(.*)$ $1?%2 [CO=utm_source:my_value_here:.example.org:1440:/,R=301]
Any help would be greatly appreciated !