Forum Discussion
MikeM_44778
Nimbostratus
Feb 28, 2010Multiple Redirect based on URI
Trying to create a single iRule to do the following:
http://website1/News/?search=1234 redirects to http://website2/News/?search=1234
http://website1/Tech/?search=1234 redirect...
The_Bhattman
Nimbostratus
Feb 28, 2010HI M.Markee,
The VIP address should have the default pool assigned to it
The following iRule basically checks the HOST and then checks to see if contains either news, tech, OR sports in the URI. If it does detect it then redirect to website2, otherwise it will not redirect and ultimately reach the default pool that was assigned to the VIP.
when HTTP_REQUEST {
if {[HTTP::host] eq "www.website1.com"} {
switch -glob [string tolower [HTTP::uri]] {
"*news*" -
"*tech*" -
"*sportspage*" { HTTP::redirect "http://website2.com/[HTTP::uri]"}
}
}
}
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
