Forum Discussion
Martin_Machacek
Aug 11, 2005Historic F5 Account
The "tolower" function converts a string to lowercase, it does not make string match case insensitive.
Correct syntax is:
if (tolower(http_uri) starts_with "/authentication") {
use pool IIS_Pool_80
} else {
use pool beta.pmi.org
}
BTW, the best way how to match one of several strings is to use a class and the "one of" operator. It is more efficient than several string match experssions ORed and also more efficient than a chain of if-else statements. One of your previous rule examples could be rewritten like this:
class allowed_uris {
"/certapp"
"/authentication"
"/lms"
}
rule r1 {
if(tolower(http_uri) starts_with one of allowed_uris) {
use pool IIS_Pool_80
} else {
use pool beta.pmi.org
}
}