For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

THASIN's avatar
THASIN
Icon for Nimbostratus rankNimbostratus
Dec 03, 2012

Query string Redirect irule

Hi All

 

 

I want to wite irule based on query parameters and value

 

whenever user click this url mentioned below

 

http://abc.xxx.com.in:7012/AB_HTML/AB.jsp?parame1=val1&parame2=val2&parame3=val3&parameter4=val4&parameter5=val5

 

 

will be redirect to

 

 

http://abc.xxx.com.in:7012/AB_HTML/AB.jsp?parame1=val1

 

query parame1 in both the URL is the same. But value is different.

 

what is the best way to write this redirect irule?

 

Appreciate your help

 

Regards

 

insitha

 

1 Reply

  • e.g.

    [root@ve10:Active] config  b virtual bar list
    virtual bar {
       destination 172.28.19.79:7012
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       if { [scan [HTTP::uri] {/AB_HTML/AB.jsp?parame1=%[^&]&parame2=%[^&]&parame3=%[^&]&parameter4=%[^&]&parameter5=%[^&]%s} v1 v2 v3 v4 v5 v6] == 5} {
          HTTP::redirect "http://[HTTP::host]/AB_HTML/AB.jsp?parame1=$v1"
       }
    }
    }
    
     on client
    
     curl -I "http://172.28.19.79:7012/AB_HTML/AB.jsp?parame1=abc123&parame2=xyz123&parame3=1234&parameter4=hello&parameter5=val5"
    HTTP/1.0 302 Found
    Location: http://172.28.19.79:7012/AB_HTML/AB.jsp?parame1=abc123
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0