Forum Discussion
Brian_Gupta_115
Nimbostratus
Jan 12, 2005Converting a 4.5 rule to an iRule
I have the following 4..5 rule that I need to convert to an irule... Can someone please help me?
Thanks,
Brian
if (http_uri contains "HR" or http_uri contains "hr") {
redirect to "https://pshr.txxx.com/hr"
}
else if (http_uri contains "SELFSERVICE" or http_uri contains "selfservice") {
redirect to "https://pshr.txxx.com/selfservice"
}
else if (http_uri contains "FINTI" or http_uri contains "finti") {
redirect to "https://psfin.txxx.com/finti"
}
else if (http_uri contains "FINTL" or http_uri contains "fintl") {
redirect to "https://psfin.txxx.com/fintl"
}
else if (http_uri contains "FINSPC" or http_uri contains "finspc") {
redirect to "https://psfin.txxx.com/finspc"
}
else {
discard
}
- unRuleY_95363Historic F5 AccountBrian,
rule my_redirect { when HTTP_REQUEST { if { [HTTP::uri] contains "HR" or [HTTP::uri] contains "hr" } { redirect to "https://pshr.txxx.com/hr" } elseif { [HTTP::uri] contains "SELFSERVICE" or [HTTP::uri] contains "selfservice") { redirect to "https://pshr.txxx.com/selfservice" } more elseif's may following here... } }
rule my_redirect { when HTTP_REQUEST { set my_uri [string tolower [HTTP::uri]] if { $my_uri contains "hr" } { redirect to "https://pshr.txxx.com/hr" } elseif { $my_uri contains "selfservice") { redirect to "https://pshr.txxx.com/selfservice" } more elseif's may following here... } }
- Brian_Gupta_115
Nimbostratus
Your examples where very helpful... My final rule:
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