Forum Discussion
Kai_Wilke
Dec 15, 2016MVP
Hi networkdawg,
you may try the iRule below.
It uses the
[domain]
command to extract the first three dotted domain elements (e.g. four.third.second.frist) from the requested HOST-header, then passes the information to a[getfield]
command to extract the third element and adds the new second and first dotted domain elements via TCL concentation...
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] ends_with ".domain1.com" } then {
HTTP::host "[getfield [domain [HTTP::host] 3] "." 1].primarydomain.com"
}
}
Cheers, Kai