Forum Discussion
Kenny_Van_73892
Nimbostratus
Oct 24, 2006Help me with redirect and match cases, please
I just recently upgraded my Big IP units from version 4.5.10 to 4.6.4 to implement new features such as tolower() in irules. The upgrade went well, but when I tried to use tolower() and redirect in a...
Martin_Machacek
Oct 24, 2006Historic F5 Account
Kenny,
the correct syntax is:
if (tolower(http_uri) contains "logon") {
redirect to "https://%h/%u"
}
else {
discard
}
The tolower(string) function returns lowercase version of the string you pass it as argument. It does not change the original string. It does not interfere with redirection in any way. Keep in mind though that the URI expanded in place of the %u in the redirect string will have the original capitalization. If you want to insert lowercase version of the URI into the redirection string you need to use:
redirect to "https://" + http_host + tolower(http_uri)
The test on server_port == 80 is redundant if you attach the rule to a port 80 virtual server, like this:
virtual 1.2.3.4:80 {
use rule your_rule
}
(the server_port is always going to be 80 in this case)
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