I have a redirect from http://example.com to http://www.example.com.
now i want this redirect to work when the user is in https protocol. meaning to redirect from https://example.com to https://www.example.com.
is it possible?
if not, how do i redirect https://example.com/page to http://example.com or http://www.example.com
i hope i was clear
Redirecting from
https://example.comtohttps://www.example.comworks in the same way as redirecting fromhttp://example.comtohttp://www.example.com, except that you have to put the rewrite rules in your SSL-enabledVirtualHostin addition to your plain HTTPVirtualHostsection.Where you may get a problem is that, for this to work, you need the initial connection to
https://example.comto work and be accepted by the browser. For this, you need your certificate to be valid for bothwww.example.comandexample.com. This is typically done by using multiple Subject Alternative Names in your server certificate (you should be able to see this by looking at the details of your certificate). Some CAs issue certificates both with and without thewww.prefix.