Optimizing redirects to avoid TCL error "Multiple redirect/respond invocations"
Hi everyone,
I would like to ask for help in finding the reason why following rule (stripped out of confidential data) is causing the error of:
Fri Nov 23 04:06:03 GMT 2012 err local/tmm3 tmm3[6833] 01220001 TCL error: goRedirects - Operation not supported. Multiple redirect/respond invocations not allowed (line 21) invoked from within "HTTP::respond 301 Location $rdr_target"
Fri Nov 23 04:06:04 GMT 2012 err local/tmm3 tmm3[6833] 01220001 TCL error: goRedirects - Operation not supported. Multiple redirect/respond invocations not allowed (line 17) invoked from within "HTTP::respond 301 Location "http://blabla/vod/page/default/home.do""
Fri Nov 23 04:06:04 GMT 2012 err local/tmm tmm[6830] 01220001 TCL error: goRedirects - Operation not supported. Multiple redirect/respond invocations not allowed (line 11) invoked from within "HTTP::respond 301 Location $rdr_target"
Fri Nov 23 04:07:46 GMT 2012 err local/tmm1 tmm1[6831] 01220001 TCL error: goRedirects - Operation not supported. Multiple redirect/respond invocations not allowed (line 21) invoked from within "HTTP::respond 301 Location $rdr_target"
Fri Nov 23 04:08:23 GMT 2012 err local/tmm3 tmm3[6833] 01220001 TCL error: goRedirects - Operation not supported. Multiple redirect/respond invocations not allowed (line 11) invoked from within "HTTP::respond 301 Location "http://blabla[HTTP::uri]""
The rule:
when HTTP_REQUEST {
log local0. "Found [HTTP::host]"
if { [HTTP::path] equals "/" or [HTTP::path] equals "/vod" } {
HTTP::path "/vod/"
}
set rdr_target [class match -value [HTTP::uri] equals some_uri_redirects]
if { $rdr_target ne "" } {
HTTP::respond 301 Location $rdr_target
log local0. "Found match with value = $rdr_target"
}
if { [HTTP::path] starts_with "/watch" } {
HTTP::respond 301 Location "http://blabla/vod/page/default/home.do"
}
if { [HTTP::host] equals "blabla" } {
log local0. "Found [HTTP::host]"
set rdr_target [class match -value [HTTP::uri] equals someother_uri_redirects]
if { $rdr_target ne "" } {
HTTP::respond 301 Location $rdr_target
log local0. "Found match with value = $rdr_target for blabla"
} else {
if { [TCP::local_port] equals "80" } {
HTTP::respond 301 Location "http://blabla[HTTP::uri]"
} else {
HTTP::redirect "https://blabla[HTTP::uri]"
}
}
}
}
Thanks in advance!
S.