Forum Discussion
Set up iRule to direct traffic to an IP address based on URL string
Hi, we would like to set up an iRule to direct traffic based on URL to a list of IP addresses. How would I set that up?
Thank you,
Kim V
1 Reply
- DanS92
Cirrus
You can do it like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"abc.domain.com" {
pool Pool_Number1 }
"def.domain.com" {
pool Pool_Number2 }
}
}
Or you can use a local traffic policy like this:
I prefer to use the Local Traffic Policy, because then you can see the pool on the Network Map. The pool doesn't show up on the Network Map with an iRule.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
