Forum Discussion
KD_48848
Nimbostratus
Aug 10, 2007URL convertion from upper case to lower case
We are currently having many redirect rules in place for one of our clients. The issue is that while redirecting we are giving conditions to match upper and lower case.
Is there any way tha...
KD_48848
Nimbostratus
Aug 15, 2007Hi,
The host URI is "www.abc.com" or "abc.com" or "WWW.ABC.COM" or "ABC.COM" and the above URI's are ending with "/def","/ghi", "/jkl" in both upper and lower cases etc...
We tried using the "tolower" feature but it’s supported in BigIP v9.X and we are using v4.5.X
We tried to compare the lower and upper case host_URI's and then lower and upper case ends_with conditions as follows:
To redirect "www.abc.com/def" or "WWW.ABC.COM/DEF" to "www.xyz.com/mno"
( we have similar rules in place for "/ghi", "/jkl" after the below mentioned rule)
===========
else if (http_host == "www.abc.com" or http_host == "WWW.ABC.COM" and http_uri ends_with "/def" or http_uri ends_with "/DEF") {
redirect to "www.xyz.com/mno"
}
else if (http_host == "www.abc.com" or http_host == "WWW.ABC.COM" and http_uri ends_with "/ghi" or http_uri ends_with "/GHI") {
redirect to "www.xyz.com/pqr"
}
else if (http_host == "www.abc.com" or http_host == "WWW.ABC.COM" and http_uri ends_with "/jkl" or http_uri ends_with "/jkl") {
redirect to "www.xyz.com/stu"
}
===========
But in this case, the very first condition in the rule is getting redirected as desired, but the lower two conditions are also getting redirected according the to the first condition.
So we tried comparing just the ends_with condition for lower and upper cases and keeping the host URI in lower case only, and it works as desired.
==========
else if (http_host == "www.abc.com" and http_uri ends_with "/def" or http_uri ends_with "/DEF") {
redirect to "www.xyz.com/mno"
}
else if (http_host == "www.abc.com" and http_uri ends_with "/ghi" or http_uri ends_with "/GHI") {
redirect to "www.xyz.com/pqr"
}
else if (http_host == "www.abc.com" and http_uri ends_with "/jkl" or http_uri ends_with "/jkl") {
redirect to "www.xyz.com/stu"
}
==========
We would like to know if BigIP v4.5.X also has a feature like "tolower" which is available in BigIP v9.0 and above.
If not then what is the proposed solution for this?
Thanks,
KD
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