when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] ends_with "oldsite.com") && ([HTTP::path] eq "/") } {
Intercept with a redirect to http://www.newsite.com
HTTP::respond 301 Location "http://www.newsite.com/" Connection Close
} elseif { ([string tolower [HTTP::host]] ends_with "oldsite.com") && ([HTTP::path] ne "/") } {
Forward traffic to HTTP pool
pool NameOfMyHTTPpool80
} else {
Generic HTTP to HTTPS redirect (ORIGINAL request Host and URI are retained)
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]" Connection Close
}
}