Forum Discussion
Anuj_Chaudhary_
Nimbostratus
Feb 11, 2016URL redirection
Hi,
URl3https://uatservices.goindigo.in should be redirectd both servers like 1.2.3.4 and 1.2.3.5
but below urls should be redirected to the only one pool member 1.2.3.4
https://uatservic...
lunitic_56137
Nimbostratus
Feb 11, 2016With that many URI's you may want to use a switch statement. The base URL with no URI would end up being the last matching statement.
https://devcentral.f5.com/questions/host-with-multiple-uri
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"*/uri-1/*" -
"*/uri-2/*" {
HTTP::redirect "https://www.mysite.com[HTTP::uri]"
or use:
pool my_pool-1
return
}
"*/uri-3/*" {
pool my_pool-2
return
}
}
default {
if {[string tolower [HTTP::uri]] equals "/"} {
HTTP::redirect "https://www.myothersite.com[HTTP::uri]"
return
}
}
}
HTH,
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