Forum Discussion
Yozzer
Dec 14, 2010Nimbostratus
I found this from a previous post and added your recommendations but found it doesnt save the rule on the BIGIP or give me feedback on its syntax. Also when posting the last part renders html which i took from the "Redirect POST data while load balancing GET iRule" http://devcentral-sea.f5.com/Forums/tabid/1082223/asg/50/showtab/groupforums/aff/5/aft/1172096/afv/topic/Default.aspx :
when HTTP_REQUEST {
if {([HTTP::method] eq "POST") && ([HTTP::uri] eq "/test")} {
HTTP::collect [HTTP::header "Content-Length"]
}
}
when HTTP_REQUEST_DATA {
switch -glob [URI::decode [URI::query "?[HTTP::payload]" Relay]] {
"*/test2/*" {
set static::ext_url "https://test.com/test2/login.aspx"
}
"*/test3/*" {
set static::ext_url "https://test.com/test3/login.aspx"
}
set content " \
<form>>> name=f action='$static::ext_url' method=post>"
foreach p [split [HTTP::payload] &] {
set name [getfield $p = 1] set value [decode_uri [getfield $p = 2]]
set content "${content}" }
set content "${content}</form>"
HTTP::respond 200 content $content
}