This is what one of our internal programmers came up with. However, it doesn't work 100% of the time.
when HTTP_REQUEST {
set header [HTTP::host]
set splitVals [split $header "."]
set urlPartCount [llength $splitVals]
if {$urlPartCount eq 4} {
set firstPart [string tolower [lindex $splitVals 0]]
switch $firstPart {
"hrp"
{
set splitVals [lreplace $splitVals 0 0]
lset splitVals 0 [lindex $splitVals 0]hrp
}
"www"
{
set splitVals [lreplace $splitVals 0 0]
}
}
set returnVal [join $splitVals "."]
HTTP::redirect "https://$returnVal"
}
}
Any ideas???
Thanks!
Phil