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...
Arie
Altostratus
May 11, 2015I would recommend converting the URL to lowercase before doing the comparison. Just make sure you always enter the values you want to check for in lowercase.
So, instead of:
if {[HTTP::uri] starts_with "/atm/"
[class match [HTTP::uri] contains my_uri_datagroup] }
You would use:
if {[string tolower[HTTP::uri]] starts_with "/atm/"
[class match [string tolower [HTTP::uri]] contains my_uri_datagroup] }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