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:


