Forum Discussion
THASIN
Nimbostratus
Dec 03, 2012Query 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¶me2=val2¶me3=val3¶meter4=val4¶meter5=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
- nitass
Employee
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=%[^&]¶me2=%[^&]¶me3=%[^&]¶meter4=%[^&]¶meter5=%[^&]%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¶me2=xyz123¶me3=1234¶meter4=hello¶meter5=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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects