Forum Discussion

jato_40959's avatar
jato_40959
Icon for Nimbostratus rankNimbostratus
May 10, 2010

Irule redirects

Hello all,

 

 

Can I do this in only one irule?

 

Uri to Uri, and Uri to Url

 

Thanx and regards

 

 

Prefix: /Institucional/comercial/Acuerdos/entrada_acuerdo.asp

 

To URL prefix: /onlineCetelem/FcControlador.srvl?COMANDO=ENTRADA_ACUERDO&URL_LOGICA=ACUERDOS&

 

 

Prefix: /Agencia_Online/Transaccional/Login_AgenciaOnline.asp

 

To URL prefix: http://www.cetelem.es/Agencia_Online/Transaccional/Login_AgenciaOnline.asp

 

 

 

 

 

 

 

3 Replies

  • Hi jato,

    you can do it with redirect (by client) or replacing the http uri in the request event by bigip.

    The example:

    
      if { [HTTP::uri] starts_with "/Institucional/comercial/Acuerdos/entrada_acuerdo.asp" } {
        HTTP::uri /onlineCetelem/FcControlador.srvl?COMANDO=ENTRADA_ACUERDO&URL_LOGICA=ACUERDOS&
    
      } elseif { [HTTP::uri] starts_with "/Agencia_Online/Transaccional/Login_AgenciaOnline.asp" } {
        HTTP::redirect " http://www.cetelem.es/Agencia_Onlin...Online.asp"
      }
     

    I hope this helps.

    Cheers

    Marek
  • A switch statement would probably be easier to set up and manage. Here is a basic example you could use to get started with.

    
    when HTTP_REQUEST {
    
       switch -glob [string tolower [HTTP::uri]] {
          "/Institucional/comercial/Acuerdos/entrada_acuerdo.asp*" {
             HTTP::uri "/onlineCetelem/FcControlador.srvl?COMANDO=ENTRADA_ACUERDO&URL_LOGICA=ACUERDOS&;"
          }
          "/Institucional/comercial/Acuerdos/Entrada_acuerdo.asp*" }
             HTTP::uri "/onlineCetelem/FcControlador.srvl?COMANDO=ENTRADA_ACUERDO&URL_LOGICA=ACUERDOS&;"
         }
          "/zonacliente*" {
             HTTP::uri "/zonaClienteCetelem/;"
         }
          default {
              Take some default action?
          }
       }
    }
    

    Aaron