How to destroy and replace a URI query value ?
Hi,
I am trying to figure out how I can replace a URI query value.
For example for this we will select the URL based on the HTTP:host
Incoming URL pattern
https://host/URI? https://host/URI?query=any_value
Rewrite URL https://host/URI?query=ReplacedValue
Can this be done?
What I have done is as follows which looks for anything matching the URI and does a rewrite does not really match my requirement
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "host" } { switch -glob [string tolower [HTTP::uri]] { "/URI*" { log local0. "Incoming URI = [HTTP::uri]" log local0. "URI Query = [URI::query [HTTP::uri]]" HTTP::uri "/URI?query=ReplacedValue" log local0. "Changed URI = [HTTP::uri]" } } } }
Thanks.