Forum Discussion
Mohammad_Hamad_
Dec 09, 2015Nimbostratus
iRule Assistance
Hello, Glorious people of DevCentral,
I am facing an issue with a couple of iRules that are doing the same thing. First off, here is what the iRule looks like:
when HTTP_REQUEST {
...
VernonWells
Dec 09, 2015Employee
Also, for what its worth, the
match_regex
is a fairly expensive way to achieve what you want above. This is a more efficient method:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "example.home.com" } {
switch -glob [HTTP::path] {
"/home" -
"/home/*" -
"/home/services" -
"/home/services/*" -
"/home/services/register" -
"/home/services/register/*" -
"/index" -
"/index/*" -
"/default" -
"/default/*" {
pool myPool
ASM::enable MyPoolASM
}
}
}
}
It's probably also worth mentioning that /home/services(/.*) and /home/services/register(/.*) are covered by the /home(.*) branch. Also, your regexps end with the literal ?, but that is not part of
HTTP::path
, so that will never match.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