Forum Discussion
David_Robert_11
Nimbostratus
Mar 11, 2010uri and pool redirection
Hi,
I think there may be an easy way to do this, I can get some of it to work, but not all of it.
We have a need to redirect traffic to a different pool, based off...
The_Bhattman
Nimbostratus
Mar 11, 2010Hi David,
I am assuming that www2.xyz.com and www.xyz.com are pointing to the same VIP.
Based on this you can do the following
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/site2" {pool pool2 }
default {pool pool1 }
}
}
or if you assign pool1 as the default pool then you can also right it as
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/site2" {pool pool2 }
}
}
--------------
if http://www2.xyz.com/site2 is pointing a seperate vip then the iRule would look something like the following:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/site2" {HTTP::redirect "http:\\www2.xyz.com\Site2" }
default {pool pool1 }
}
}
or if you assign pool1 as the default pool then you can also right it as
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/site2" {HTTP::redirect "http:\\www2.xyz.com\Site2" }
}
}
I hope this helps
Bhattman
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