Forum Discussion

Scott_82785's avatar
Scott_82785
Icon for Nimbostratus rankNimbostratus
Apr 08, 2008

Redirecting Multiple Domains to a .com

I'm currently trying to redirect Multiple Domains pointing to the same vip and redirecting to a .com domain name.

 

 

: if (domain(http_host,1) == "gov" or

 

domain(http_host,1) == "info" or

 

domain(http_host,1) == "net" or

 

domain(http_host,1) == "org" or

 

domain(http_host,1) =="us" ) {

 

redirect to http://mydomain.com

 

}

 

else {

 

use pool mydomain-prod

 

}

 

 

All the domains start with mydomain to the same vip.

2 Replies

  • My 4.x syntax is rusty, but that looks okay. Is the rule working? If not, what are the symptoms?

     

     

    Also, if all requests should be made to mydomain.com, could you just redirect to http://mydomain.com if the host isn't mydomain.com?

     

     

    Aaron
  • Thanks Aaron.

     

     

    N ohave not tried it yet because this is a production. Looks like we will try it on our next maint window.