Forum Discussion
irule query on uri match
Hi,
Have a question on following irule.
when HTTP_REQUEST { log local0. "Host header is [HTTP::host]" switch [string tolower [HTTP::host]] { "example1.com" { log local0. "matched example1.com" pool number1 } "example2.com" { log local0. "example2.com" pool number2 } } }
Wanted to know whether this irule will match to exact URL http://example1.com and http://example2.com or it can also match http://www.example1.com and http://www.example2.com
- Lee_Sutcliffe
Nacreous
You can need to use
type matching so that you can match on and example.com. "*example1.com" essentially means - a host header that ends with "example1.com"-glob
when HTTP_REQUEST { log local0. "Host header is [HTTP::host]" switch -glob [string tolower [HTTP::host]] { "*example1.com" { log local0. "matched example1.com" pool number1 } "*example2.com" { log local0. "example2.com" pool number2 } } }
Recent Discussions
Related Content
* 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