Hi wadeziegler,
Can you try this?
when HTTP_REQUEST {
if { [HTTP::query] contains "reversedmarker" } {
set uri [HTTP::uri]
set reversedmarkervalue [URI::query $uri reversedmarker]
set markervalue "[getfield $reversedmarkervalue "," 2],[getfield $reversedmarkervalue "," 1]"
set newuri [string map [list $reversedmarkervalue $markervalue "reversedmarker" "marker" ] $uri]
HTTP::uri $newuri
# for redirect
# HTTP::redirect https://[HTTP::host]$newuri
unset uri reversedmarkervalue markervalue newuri
}
}
or shorter but less readable:
when HTTP_REQUEST {
if { [HTTP::query] contains "reversedmarker" } {
HTTP::uri [string map [list "[URI::query [HTTP::uri] reversedmarker]" "[getfield [URI::query [HTTP::uri] reversedmarker] "," 2],[getfield [URI::query [HTTP::uri] reversedmarker] "," 1]" "reversedmarker" "marker"] [HTTP::uri]]
# for redirect
# HTTP::redirect https://[HTTP::host][string map [list "[URI::query [HTTP::uri] reversedmarker]" "[getfield [URI::query [HTTP::uri] reversedmarker] "," 2],[getfield [URI::query [HTTP::uri] reversedmarker] "," 1]" "reversedmarker" "marker"] [HTTP::uri]]
}
}