Forum Discussion
Stanislas_Piro2
Oct 06, 2017Cumulonimbus
you can try something like that
switch -glob -- [set host [HTTP::host]] {
"www.*.domain.com" { HTTP::respond 301 noserver Location "https://[getfield $host "." 2].domain.com${uri}"}
"www.domain.co.*" { HTTP::respond 301 noserver Location "https://[getfield $host "." 4].domain.com${uri}"}
"www.domain.*" { HTTP::respond 301 noserver Location "https://[getfield $host "." 3].domain.com${uri}"}
}
Note: Edited to correct getfield command