Forum Discussion

Joseph_Cannon_4's avatar
Joseph_Cannon_4
Icon for Nimbostratus rankNimbostratus
Aug 18, 2005

redirect and use same pool

We would like to change the hostname of the website and have user dynamically redirected, even if they have it bookmarked with a long uri.

 

DNS resolves the same for both names.

 

 

Here is what I thought would have worked.

 

 

if (http_host contains "abc") {

 

redirect to "https://cba.mycompany.com/%u"

 

use pool cba

 

}

 

else {

 

use pool cba

 

}

 

 

 

Any thoughts?

 

 

Thanks.
  • a redirect will send a HTTP redirect to the url you specify back to the browser so you don't need to specify the "use pool cba" after the redirect.

    If you set your default pool on your virtual to "cba", then your rule could be as simple as this

    if (http_host contains "abc" ) {
      redirect to "https://cba.mycompany.com/%u"
    }

    The things you need to watch out for in situations like this is to avoid a recursive loop. In this case the redirect will only occur if "abc" is in the host and you are redirecting to a host that does not contain "abc" so you should be safe.

    -Joe
  • Disregard the comment about omitting the default pool. I was thinking BIG-IP v9.x, not 4.x.

     

     

    -Joe
  • Martin_Machacek's avatar
    Martin_Machacek
    Historic F5 Account
    In BIG-IP v4.x "redirect to" and "use pool" statements are mutually exclusive. There is also little reason why to pick a node to answer the request if the rule has already determined that redirect (HTTP 302) need to be returned.