Forum Discussion
What_Lies_Bene1
Nov 23, 2012Cirrostratus
If those other rules contain redirect or respond commands, that'll be the issue. You're best bet is to combine any of the rules that contain redirect/respond commands. I'd also carefully check your rule logic to ensure a request can't match two criterea by using elseif and/or return statements. Here's an example (a bit overkill) using your rule above;
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"
return
}
elseif { [HTTP::path] starts_with "/watch" } {
HTTP::respond 301 Location "http://blabla/vod/page/default/home.do"
return
}
elseif { [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"
return
}
else {
if { [TCP::local_port] equals "80" } {
HTTP::respond 301 Location "http://blabla[HTTP::uri]"
return
} else {
HTTP::redirect "https://blabla[HTTP::uri]"
}
}
}
}