cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Irule for transparent redirect

KJ_50941
Nimbostratus
Nimbostratus

Hi, I need an iRule for transparent redirect, basically I have VIP in legacy floor which needs to send partial traiffic to another VIP for example application 1 while they are migration all applications to new servers..

 

will below irule works? is this transparent to Clinets? I am going to aplly below iRule on legacy VIP.

 

when HTTP_REQUEST {

 

switch -glob [string tolower [HTTP::uri] ] {

 

"/app/*" {

 

HTTP::redirect “https://www.example.com[HTTP::uri]”

 

}

 

“/app2*” {

 

HTTP::redirect “https:://www.example .com[HTTP::uri]”

 

}

 

}

 

 

Please help.

 

 

thx

 

 

 

3 REPLIES 3

Kevin_Stewart
F5 Employee
F5 Employee
The HTTP::redirect command is NOT transparent to clients. It will send a 302 redirect back to the client browser, changing the address bar. To transparently change the URI without the client seeing it, use the HTTP::uri command.

 

nitass
F5 Employee
F5 Employee
basically I have VIP in legacy floor which needs to send partial traiffic to another VIP for example application 1 while they are migration all applications to new servers.what is "another vip" indeed? is it another virtual server on the same or different bigip or something else?

 

 

if same, you may try "virtual" command.

 

 

virtual wiki

 

https://devcentral.f5.com/wiki/irules.virtual.ashx

 

 

if different, you may try "node" command.

 

 

node wiki

 

https://devcentral.f5.com/wiki/iRules.node.ashx

KJ_50941
Nimbostratus
Nimbostratus

another VIP is The VIP on different F5 in SAT envirornmnet. Can you tell me what is going to be actual iRule?

 

 

will this work?

 

 

when HTTP_REQUEST {

 

switch -glob [string tolower [HTTP::uri] ] {

 

"/app/*" {

 

HTTP::uri “https://www.example.com[HTTP::uri]”

 

}

 

“/app2*” {

 

HTTP::uri “https:://www.example .com[HTTP::uri]”

 

}

 

}

 

 

 

thx