Forum Discussion
f5_rocks
Nimbostratus
Jun 01, 2016How to expand irule using switch or logical or in selection process?
Developers want to add more "lanes" for multiple branches, so I want to add 3 more versions of "starts_with" and make the "if nots" more generic so they can apply to all the "starts_with" versions. ...
Stanislas_Piro2
Cumulonimbus
Jun 01, 2016Hi,
you can try this irule:
when HTTP_REQUEST {
set MY_HOST [string tolower [HTTP::host]]
set MY_URI [string tolower [HTTP::uri]]
switch -glob $MY_URI {
"*/web/abcdpayment.web/*" -
"*/web/abcdpaymentprocessing.web/*" {TCP::close}
"/abcd/*" -
"/abcd_lane2/*" -
"/abcd_hotfix/*" {
switch $MY_HOST {
"m3.corpname.com" {HTTP::redirect http://a1.m3.corpname.com$MY_URI}
"intra.m3.corpname.com" {HTTP::redirect http://intra.a1.m3.corpname.com$MY_URI}
"intra.m3-dc1.corpname.com" {HTTP::redirect http://intra.a1.m3-dc1.corpname.com$MY_URI}
"intra.m3-dc2.corpname.com" {HTTP::redirect http://intra.a1.m3-dc2.corpname.com$MY_URI}
"intra.m3-dc3.corpname.com" {HTTP::redirect http://intra.a1.m3-dc3.corpname.com$MY_URI}
}
TCP::close
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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