Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to redirect one virtual server to another through irules

Dilip_bhapkar06
Nimbostratus
Nimbostratus
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 5

kris_52344
Nimbostratus
Nimbostratus
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

 

}

 

}

 

 

Dilip_bhapkar06
Nimbostratus
Nimbostratus
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.

Dilip_bhapkar06
Nimbostratus
Nimbostratus
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.

Vladyslaw
Nimbostratus
Nimbostratus

when HTTP_REQUEST {

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

   virtual Virtual_Server_1

 }

}

 

Did this work for anyone?