Forum Discussion
jwitko
Nimbostratus
Jun 05, 2013Can I use a wildcard inside a HTTP::host contains conditional?
I have the following iRule:
when HTTP_REQUEST {
if {[HTTP::host] contains "example.domain.com" } {
switch -glob [HTTP::uri] {
"*example=e*" { pool examplee_htt...
Kevin_Stewart
Employee
Jun 06, 2013You cannot use wildcards with the contains operator, but you could use an equivalent string function:
when HTTP_REQUEST {
if { [string match "example*.domain.com" [string tolower [HTTP::host]]] } {
switch -glob [string tolower [HTTP::uri]] {
"/example=e*" { pool local-pool }
"/example=f*" { pool local-pool }
"/example=g*" { pool local-pool }
default { pool local-pool }
}
}
}
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