Related question. Can someone help combine a redirect rule that looks for both the host and uri (everything after the /)?
Our existing rule which uses HTTP::host works just fine:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"*sample*" {HTTP::redirect "http://site.sample.com/default.aspx"}
"*test*" {HTTP::redirect "https://site.test.com/Pages/home.aspx"}
default {HTTP::redirect "https://www.test.com"}
}
}
Problem now is that I'm being asked to redirect *sample.com/folder1 to -> http://site.sample.com/folder1. I tried adding an IF before the switch statement (using HTTP::path and HTTP::uri) with minimal success. How would you go about doing this?
Thanks in advance for the support.