Forum Discussion
George_32239
Nimbostratus
Oct 27, 2009Multiple comparisons in an iRule
Hello All,
I need a rule that will look at a hostname the [HTTP::host] and also looke at part of the URI, the [HTTP:uri] bit.
If both conditions are the same I need to se...
hoolio
Cirrostratus
Oct 27, 2009Hi George,
There are quite a few examples in the forums and the iRules wiki of iRules which check the host (retrieved using HTTP::host Click here) and the URI (retrieved using HTTP::uri Click here).
Here is one example of checking the host and URI to select corresponding pools:
when HTTP_REQUEST {
This event is triggered when LTM parses the HTTP request headers
Check requested host using lower case
if {[string tolower [HTTP::host]] eq "subdomain.example.com"}{
Check the requested URI
if {[HTTP::uri] starts_with "/some_uri"}{
pool some_pool
} else {
pool other_pool
}
} else {
pool some_other_pool
}
}
Aaron
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
