Forum Discussion
nathe
Jul 01, 2015Cirrocumulus
is this neater and more efficient? let me know if it doesn't meet all your requirements. Away from the lab at the moment to test.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"team.domain.org" { HTTP::respond 301 Location "https://team.domain.com[HTTP::uri]" }
"site1.domain.org" { HTTP::respond 301 Location "https://site1.domain.com[HTTP::uri]" }
"site2.domain.org" { HTTP::respond 301 Location "https://site2.domain.com[HTTP::uri]" }
"myteam.domain.org" { HTTP::respond 301 Location "https://myteam.domain.com[HTTP::uri]" }
"*.domain.com" { HTTP::respond 301 Location "https://[HTTP::host]/default.aspx" }
}
}
Obviously a 301 is permanent redirect, i've assumed this.
N