Forum Discussion
F_Ibrahim_32340
Nimbostratus
Jul 05, 2017Need help building simple iRule
Hi Guys and Girls,
I need to create a simple iRule but sadly even simple is hard for me. The iRule should do the following:
If there is an http request which does not contain or equal bus...
cjunior
Nacreous
Jul 05, 2017Hello,
If you do not know how to create an iRule to this case, you can try an LTM policy and do the same thing, which can help you easely. https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-basics-11-6-0/6.htmlAnyway, You could do like this:
e.g. 1
when HTTP_REQUEST {
Path is portal.hml or not begins with /business/portal.
if { [HTTP::path] eq "/business/portal.html" || not ( [HTTP::path] starts_with "/business/portal." ) } {
pool pool1
} else {
pool pool2
}
}
e.g. 2
when HTTP_REQUEST {
Path begins with "/business/portal." and is not "/business/portal.html"
if { [HTTP::path] starts_with "/business/portal." && [HTTP::path] ne "/business/portal.html" } {
pool pool2
} else {
pool pool1
}
}
If url is case insensitive, you may need to change it into. e.g.
[string tolower [HTTP::path]] eq "/test.html" or [string toupper [HTTP::path]] eq "/TEST.HTML"
Regards
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