rkrenzis
Apr 18, 2014Nimbostratus
HTTPS: Remove www. from hostname
This code appears to work for our HTTP (plain-text sites):
when HTTP_REQUEST {
Check if the host starts with www.
if {([string tolower [HTTP::host]] starts_with "www.")} {
HTTP::header replace Host "[string range [HTTP::host] 4 end]"
}
}
It does not work when applied to a HTTPS enabled VIP. Is there something else I need to do to when using HTTPS?
What is needs to happen: Global rule which will look for any string which begins with "www." and remove it. What is expected: www.site1.com becomes site1.com; www.site2.com becomes site2.com