how to redirect https:// to https://www



I know how to redirect from: to

and to

but not how to redirect from: to

I am using on the virtual server for port 80 : (this works fine)

RedirectMatch 301 ^/$
RedirectMatch 301 ^(.*)$
RedirectMatch 301 ^$

I tried using on the virtual server port 443, but it does not work.

Redirectmatch 301 ^


You would need to have a certificate that matches, as well as your standard certificate, since you can’t redirect until after an SSL channel has been established.

Most people wouldn’t think it was worth the expense of obtaining two certificates for each domain, just to achieve a redirect. A Wildcard certificate wouldn’t help here (I believe), since I think all domains covered by a wildcard cert have to be at the same level (e.g. * would be valid for and, but not for just

Answered By – Damien_The_Unbeliever

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More