Forum Discussion
Stanislas_Piro2
Aug 24, 2021Cumulonimbus
Hi,
string tolower command does not convert HTTP::uri to lowercase but returns lowercase of HTTP::uri
So even if it matches the condition :
{ ([string tolower [HTTP::host]] eq "www.abc.com") and ([string tolower [HTTP::uri]] starts_with "/app/topic/") }
[string map {/app/topic/ /redirectlegacy/abc/app/topic/} [HTTP::uri]] will work with original HTTP::uri value.
you should change the code to this one to returns lowercase uri
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] eq "www.abc.com") and ([string tolower [HTTP::uri]] starts_with "/app/topic/") } {
HTTP::redirect "https://www.xyz.com[string map {/app/topic/ /redirectlegacy/abc/app/topic/} [string tolower [HTTP::uri]]]"
}
}