Hi Yan,
1. string map
when HTTP_REQUEST {
if { [HTTP::host] starts_with "www." } {
HTTP::redirect https://[string map {www. ""} [HTTP::host]][HTTP::uri]
}
}
2. string range
when HTTP_REQUEST {
if { [HTTP::host] starts_with "www." } {
HTTP::redirect https://[string range [HTTP::host] 4 end][HTTP::uri]
}
}
3. getfield
when HTTP_REQUEST {
if { [HTTP::host] starts_with "www." } {
HTTP::redirect https://[getfield [HTTP::host] "www." 2][HTTP::uri]
}
}
4. substr
when HTTP_REQUEST {
if { [HTTP::host] starts_with "www." } {
HTTP::redirect https://[substr [HTTP::host] 4][HTTP::uri]
}
}