HTTPS issues in tandem with www subdomain

My app on gh-pages works very nicely, except that leads to “Connection isn’t private” warning page. Following are relevant info:

  • Custom domain in use is:
  • “Enforce HTTPS” is enabled via repo settings.
  • Relevant DNS records:
    •   A
    •    CNAME
  • This is a pure frontend site that leverages React.js (not sure if relevant).

Here’s how different URLs behave:

So that last case is the problematic one. Any clues why is shows a warning instead of redirecting to the apex domain right away?

Thanks for your help, and apologies if I missed relevant documentation.



Although I do not know the reason that this happens, I have experienced it myself, and through research. I have found a fix to it.

I’m not sure what domain registrar you bought your domain from, but it doesn’t really matter. I got mine from Google Domains. I found a really good site, called Cloudflare( It is even better than Google’s name servers. I suggest you use their service, as they provide really fast stuff for free and they can fix the issue.

Basically, I changed my Google domain name severs(DNS) from Google’s to Cloudflare’s, so I could control my domain from Cloudflare now. In Cloudflare, there is a section called “Page Rules,” where you can make rules such as redirects. From there, I made a page rule that said that any address with ** will be redirected to$2 . * is a wildcard character, so anything before www will be redirected to$2 . The $2 means anything after the / will replace $2. I have attached a picture with my example as well for you to use.

Sorry for the long explanation, I’m bad at explain things.


That’s a great idea! Thank you very much. I’m attempting to move NS to Cloudflare now. WIll update this thread asap.

1 Like