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. ...
f5_rocks
Nimbostratus
Jun 04, 2016The proposed solution did not work, so I started over with my rule and incorporated the easy switch for the hostnames.
when CLIENT_ACCEPTED {event HTTP_REQUEST enable}
when HTTP_REQUEST {
set MY_HOST [string tolower [HTTP::host]]
set MY_URI [string tolower [HTTP::uri]]
if {$MY_URI starts_with "/abcd"} {
if {not ($MY_URI contains "/abcdpayment.web/") and not ($MY_URI contains "/abcdpaymentprocessing.web/")} {
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-dc2msp.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}
}
}
event HTTP_REQUEST disable
TCP::close
}
}
when HTTP_RESPONSE {event HTTP_REQUEST enable}
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