Michael_Farnan_
May 25, 2007Nimbostratus
Redirect HTTPs without error message.
For some reason a group of pamphlets got sent out for our website without the preceding www. I don't have a certificate for just the 2nd level domain name. So I am trying to find a way to redirect https requests without the client recieving an error. Below is what i've got but they still recieve an error stating the certificate does not match.
This redirects https request without www to an https request with www and the same path.
If a client is coming in without the www they are redirected to www
when HTTP_REQUEST {
if {([HTTP::host] equals "foo.com")}
{
log local0. "[IP::client_addr] was misdirected"
HTTP::redirect https://www.[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}