Forum Discussion
Tim_K_92675
Jan 29, 2016Cirrostratus
If you consistently maintain your data group names without 'www.' then you could pull in the requested hostname, strip off www. if it exists, and then run it through the data group. Something like this (untested)...
when HTTP_REQUEST {
if { [string range [HTTP::host] 0 3] eq "www." } {
set hostname [string range [HTTP::host] 4 end]
} else {
set hostname [HTTP::host]
}
if {[class match $hostname eq group_80_host_redirect]} {
HTTP::redirect [class match -value [HTTP::host] eq group_80_host_redirect]
}
}