Forum Discussion

Troy_94246's avatar
Troy_94246
Icon for Nimbostratus rankNimbostratus
Dec 10, 2009

add www to a https host II

We are trying to us certificate for website. The certificate is assigned to https://www.Blah.com

 

 

When customer types https://Blah.com as the URL, they get a certificate error. I need to change the HTTPS request from https://Blah.com to https://www.Blah.com.

 

 

I found this post http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=62114

 

 

I-rule 1

 

 

when HTTP_REQUEST {

 

if { !([string tolower [HTTP::host]] starts_with "www.") } {

 

HTTP::redirect http://www.[HTTP::host][HTTP::uri]"

 

}

 

}

 

 

and I-rule 2

 

 

when HTTP_REQUEST {

 

if { [string tolower [HTTP::host]] eq "customer.com" } {

 

HTTP::redirect "http://www.customer.com[HTTP::uri]"

 

}

 

}

 

 

 

I tested them both with no success. Any pointers would be greatly appreciated! Thanks!

 

1 Reply

  • If you can redirect the client to the correct hostname when they make an HTTP request, you can just use the existing cert. If your clients are making requests directly via HTTPS to customer.com, you could get a new UCC cert which is valid for customer.com and www.customer.com.

     

     

    Trying to redirect them from https://customer.com to https://www.customer.com won't avoid the cert mismatch error as they would get the error before you're able to redirect them.

     

     

    Aaron