Forum Discussion
Hannes_Rapp
Apr 23, 2015Nimbostratus
when HTTP_REQUEST {
switch -glob [HTTP::host][string tolower[HTTP::path]] {
"abc.com/product*" -
"abc.com/product2*" -
"abc.com/ers*" {
HTTP paths of abc.com as defined above are not redirected to HTTPS
return
}
"abc.com*" {
All other HTTP paths of abc.com are redirected to HTTPS
HTTP::respond 302 location "https://abc.com"
event disable
TCP::close
}
"osabc.com*" {
All HTTP paths of osabc.com are redirected to abc.com
HTTP::respond 302 location "http://abc.com"
event disable
TCP::close
}
}
}
Notes: you may remove the asterisks at the end of your exclusional HTTP paths (product, productX, ers) for an exact match.