Forum Discussion
dennypayne
Apr 01, 2009Employee
Hi,
One problem is the domain.com, domain.net, etc is not part of [HTTP::uri], it's the [HTTP::host]. URI is the rest of the URL after the host, so your first check would need to be against [HTTP::host] without the http://.
That said, I think you could just do:
when HTTP_REQUEST {
if { not [HTTP::host] equals "www.domain.com" }{
HTTP::redirect "https://www.domain.com"
} else {
HTTP::redirect "https://www.domain.com/[HTTP::uri]"
}
}
Denny