Forum Discussion
That will help. but here's the thing. On the virtual servers for each of those SIte's i also have a redirect to a specific login URI. Can you redirect to a pool and issue the appropriate redirect as part of the same iRUle ?
for eg when a user types in https://siteA.domain.com , pool SiteA needs to be selected and the user needs to be redirected to "https://siteA.domain.com/TC/welcome.msv" and when a user ttypes in https://siteB.domain.com, pool SiteB needs o be selected and user needs to be redirected to http://siteB.domain.com/Login/login.apsx
I started out along the path of redirecting to pools based on the URL , but did not know how to issue the redirects
Without fully understanding 100% what it is you are trying to do still (because URL redirection is independent of the actual pool selection). Here is a modified (very crude) example of what you can do with your iRule above:
when HTTP_REQUEST {
if {[HTTP::uri] contains "siteA.domain.com" } {
log local0. "SiteA Access"
pool vs_SiteA_prod_pool_pool
if {[HTTP::uri] == "" || [HTTP::uri] == "/"} {HTTP::redirect "https://[HTTP::host]/TC/welcomeA.msv"}
} elseif {[HTTP::uri] contains "SiteB.domain.com" } {
log local0. "SiteB Access"
pool vs_SiteB_prod_pool
if {[HTTP::uri] == "" || [HTTP::uri] == "/"} {HTTP::redirect "https://[HTTP::host]/TC/welcomeB.msv"}
} elseif {[HTTP::uri] contains "SiteC.domain.com" } {
log local0. "SiteC Access"
pool vs_kronos_prod_pool
if {[HTTP::uri] == "" || [HTTP::uri] == "/"} {HTTP::redirect "https://[HTTP::host]/TC/welcomeC.msv"}
} elseif {[HTTP::uri] contains "SiteD.domain.com" } {
log local0. "SiteD Access"
pool vs_SiteD_prod_pool
if {[HTTP::uri] == "" || [HTTP::uri] == "/"} {HTTP::redirect "https://[HTTP::host]/TC/welcomeD.msv"}
} else {
log local0. "SiteA"
pool vs_SiteA_prod_pool
}
}
I personally would use the switch statement for this.