Reputation: 2329
I have set up my GitHub Pages project site to enforce HTTPS, and it works fine when I browse to http://rootdomain.com, http://www.rootdomain.com, or https://rootdomain.com — they all correctly display https://rootdomain.com.
However, when I browse to https://www.rootdomain.com, I get a browser privacy error NET::ERR_CERT_COMMON_NAME_INVALID
. Is there way to make this URL redirect to https://rootdomain.com as well?
I have configured my DNS (Google Domains DNS) as follows:
My CNAME file contains rootdomain.com
, and my GitHub Pages Custom Domain is set up as follows:
Upvotes: 3
Views: 726
Reputation: 2329
As it turns out, my DNS provider (Google Domains) has a feature to enable SSL for Subdomain Forwarding. So I removed the CNAME for my WWW subdomain and created a Subdomain Forward Synthetic Record as follows:
Google will create an SSL cert for the subdomain, which they say can take up to 24 hours. When I did it, it only took a couple of hours. Now https://www.rootdomain forwards to https://rootdomain as expected.
Upvotes: 2