Forum Discussion

KJ_50941's avatar
KJ_50941
Icon for Nimbostratus rankNimbostratus
Apr 25, 2013

Irule for transparent redirect

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

  • 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.

     

  • 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
  • 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