Forum Discussion
Cindy_127211
Aug 16, 2006Nimbostratus
I have tried the fomrat that you suggested below, but it doesn't work. The rules editor shows a 'red' circle next to the HTTP::host statement and I am getting the following error in the 'ltm' log.
BTW, I've also tried to put [] brackets around the HTTP::host and HTTP::uri variables, as well as use the 'set' statement in front. None of these produces the changed host or uri names according to what is logged in the ltm log.
Aug 16 08:25:20 kc0501-bigip-03 mcpd[702]: 01070151:3: Rule [lvsredirect_w_cid_test] error: line 12: [wrong args] [HTTP::host "www.americancentury.com"]
Following is the 'exact' rule that I've been trying to get to work:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/index.php"} {
Put uri into a variable
set uriValue [HTTP::uri]
Set constant string 1, 1st part
set strA "/livestrongportfolios/index.php?cid="
Get the cid uid
set ciduid [findstr $uriValue "cid=" "4" "&"]
log local0. "This is the ciduid variable: $ciduid"
Set the new url
set newuri [concat $strA$ciduid]
HTTP::host "www.americancentury.com"
HTTP::uri $newuri
log local0. "This is the newuir: $newuri"
log local0. "This is the new host: [HTTP::host]"
log local0. "This is the new uri: [HTTP::uri]"
}
else {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}