Forum Discussion

Dilip_bhapkar06's avatar
Dilip_bhapkar06
Icon for Nimbostratus rankNimbostratus
Mar 30, 2009

how to redirect one virtual server to another through irules

Hi Friend,

 

I need to redirect one virtual server to another virtual server base of url. I tried to make the URL base iRule. Please help me how i mentioned the specific virtual server name in my iRule.

 

Let say i want to redirect mail.a.com to virtual server1 and mail.b.com redirects to virtual server2.

 

Also i tagged both virtual server1 and virtual server2 with SSL certificate. so this url (mail.a.com / or mail.b.com will also be redirect to https)

 

 

Please complete the irule.

 

 

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "mail.a.com" }

 

HTTP::redirect _ _? _ _

 

}

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "mail.b.com" }

 

HTTP::redirect _ _? _ _

 

}

5 Replies

  • when HTTP_REQUEST {

     

    if { [HTTP::host] equals "mail.a.com" } {

     

    HTTP::redirect http://vs1

     

    }

     

    }

     

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::host] equals "mail.b.com" } {

     

    HTTP::redirect http://vs2

     

    }

     

    }

     

     

  • Hi Friend,

     

     

    Thanks for reply

     

     

    Its not working.. please give me another solution.. its really very urgent as well as critical issue for me...

     

     

     

    I think virtual server should be added somewhere in irules similar like.. if we want to redirect to any pool.. we have to write - pool ....

     

     

    Please help me.

     

     

    Thanks.
  • Hi Friend,

     

     

    Thanks for reply

     

     

    Its not working.. please give me another solution.. its really very urgent as well as critical issue for me...

     

     

     

    I think virtual server should be added somewhere in irules similar like.. if we want to redirect to any pool.. we have to write - pool ....

     

     

    Please help me.

     

     

    Thanks.
  • when HTTP_REQUEST {

     if { [HTTP::host] equals"site1.example.com"} {

       virtual Virtual_Server_1

     }

    }