SSL and www - handling redirect from https://mysite to https://www.mysite

by Oliver Williams   Last Updated July 12, 2019 12:00 PM - source

So this is obviously a 2x2 matrix - www and non-www, against SSL and non-SSL.

I want all traffic to be directed to SSL and www.

Getting and over to is simple; I just add this line in the <VirtualHost *.80> container:

Redirect /

And it works. The problem is getting over to I don't have a digital certificate for - the cert is written for!

I'm thinking anything I put inside the <VirtualHost *.443> wrapper (Rewrite Rules etc.) won't help because the cert validity is checked first. I'm wanting the redirect to happen BEFORE I get the scary-looking message below. How would I do this?

standard Chrome message for irregular cert

Related Questions

Redirecting https://www to https://non-www with Apache

Updated December 21, 2017 16:00 PM


Updated April 27, 2019 10:00 AM

Apache settings to prevent browser from redirect

Updated March 07, 2018 10:00 AM