Forum Discussion
kridsana
Cirrocumulus
Apr 29, 2015Simplify irule (rather than if ,elseif, elseif ...)
Hi
Is there anyway to simplify or condense this irule?
when HTTP_REQUEST
if {[HTTP::uri] starts_with "/atm/"
or [HTTP::uri] contains "/ammcontent"
or [HTTP::uri] contains...
Lee_Payne_53457
Cirrostratus
Apr 29, 2015I think you want something like:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"/atm" {
pool atm_HTTP
}
"/ammcontent*" {
pool atm_HTTP
}
}
}
You can then future proof it by redirecting based on URI and adding new lines easily.
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