Forum Discussion
Chris_DiPietro_
Mar 08, 2012Nimbostratus
redirecting urls to add www to the host if it does not exists
I have two VSs one responds to port 80 but redirects to https and one responds to HTTPS, but I want to make sure anyone trying to get to sample.com gets redirected to www.sample.com so the SSL cert ...
hooleylist
Mar 08, 2012Cirrostratus
If your cert is only valid for www.sample.com, why not redirect all HTTP requests to https://www.sample.com?
when HTTP_REQUEST {
HTTP::redirect "https://www.sample.com[HTTP::uri]"
}
Also, it's too late to bother with the HTTP hostname on the HTTPS VS as the client would have already gotten a mismatched cert warning by the time the HTTP traffic was parsed. It would be simplest to get a cert which is valid for www.sample.com and sample.com.
Else, if you have two separate certs for www.sample.com and sample.com you could use the new TLS SNI support in LTM to send the correct cert based on the server name indication in the SSL handshake. Note that some older browser don't support this though:
http://en.wikipedia.org/wiki/Server_Name_Indication
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects