Forum Discussion
Hien_Truong
Aug 23, 2021Cirrus
string tolower case not working.
Hi, i have the below irule but if any cap "uri" will not redirect correctly. I appreciate any though or input, thanks a lot. 1- this uri will redirect but not correctly https://www.abc.com/App...
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]]]"
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects