Does GitHub Pages Support HTTPS for www and @ subdomains?

Thanks for describing the problem Tsmith18256 and thanks nadiajoyce for the answer. I’m having the same problem (but with .com) and found this thread. Just want to add +1 for this feature.

So currently for me:

$ curl -I http://www.sergeyalekseev.com
HTTP/1.1 301 Moved Permanently
Location: https://sergeyalekseev.com/

$ curl -I http://sergeyalekseev.com
HTTP/1.1 301 Moved Permanently
Location: https://sergeyalekseev.com/

$ curl -I https://sergeyalekseev.com
HTTP/2 200

but

$ curl -I https://www.sergeyalekseev.com
curl: (51) SSL: no alternative certificate subject name matches target host name 'www.sergeyalekseev.com'

In my view it totally makes sense to generate an SSL certificate for a www version as well.

1 Like

I get that the feature isn’t available yet, but I find it really disturbing that the “Configuring an apex domain” doc explicitely suggests to set up both a www and an apex domain, without mentioning that this is just incompatible with using HTTPS. Thit is very misleading

14 Likes

Cross-posted at https://github.com/isaacs/github/issues/1675, hopefully this can get some more visibility…

1 Like

When is this coming? +1

Thx for this, works perfectly

Here is a short list of some of the popular websites currently broken websites to demonstrate how pevasive this issue is in practice:

Any update on the timeline to address this issue would be appreciated.

5 Likes

Just to demonstrate how common this issue is in practice, I’ve compiled a list of popular websites that are broken due to GitHub Pages incomplete implementation:

13 Likes

Hi guys, this is march 2020 and I am still having this issue, why havn’t Github team responded yet?

2 Likes

Finally found a workaround to this today!

What I did was

  • In the DNS Editor of my domain (I use GoDaddy) I added a CNAME with www as the _host, _which points to ourcompany.github.io
  • In the settings on the repository where I used to have salt.dev - I switched it to be www.salt.dev
  • The CNAME file in my repository just contains salt.dev

Now it works properly for me.

https://www.salt.dev/

https://salt.dev/

1 Like

Finally found a workaround to this today!

What I did was

  • In the DNS Editor of my domain (I use GoDaddy) I added a CNAME with www as the _host, _which points to ourcompany.github.io
  • In the settings on the repository where I used to have salt.dev - I switched it to be www.salt.dev
  • The CNAME file in my repository just contains salt.dev

Now it works properly for me.

https://www.salt.dev/

https://salt.dev/

4 Likes

@miesmandoki You just fixed it temporarily, because it already created the SSL certificate for salt.dev (without the www), and by switching it now also created the SSL certificate for www.salt.dev, but it will only renew the latter, so when the SSL certificates expires, you’ll have the same problem

2 Likes

@laurensv wrote:

@miesmandoki You just fixed it temporarily, because it already created the SSL certificate for salt.dev (without the www), and by switching it now also created the SSL certificate for www.salt.dev, but it will only renew the latter, so when the SSL certificates expires, you’ll have the same problem

Are you sure?

If that’s the case - then all I’d need to do is switch it back and forth once every three months to renew the certificates, correct?

If that’s all it takes and the certificate is still available, this definitely seems like something GitHub should go ahead and implement…

Thanks man it works now!  So annoying, lol.

@tsmith18256 wrote:

I got one of the new .app TLDs that went live today, and I am trying to point it to Github pages. I want the default URL to be without the www (host: @) and for the www to redirect to the default. I have set the domain without www in my pages repo settings, enabled https, and done the A and CNAME records in my DNS.

 

The A record is working fine, it loads my site with no www. The CNAME for www is causing an issue with the SSL certificate though. If I open the site in Edge, postman, curl, etc, it works fine; however, .app requires HTTPS and Chrome knows that, so it doesn’t even bother trying http and goes straight to the HTTPS version when you type www. This gets an error because Github returns the github.com certificate, and not my own.

 

Is there a fix for this?

yes how?
thank

1 Like

Cmon, github, I just set up everything properly (3 days of work) and boom! at the very end it turns out that you do not support https for apex and subdomains?

Please please please fix this.

More discussion here:

https://stackoverflow.com/questions/9082499/custom-domain-for-github-project-pages

and here:

https://github.com/isaacs/github/issues/1675

3 Likes

Is there an update / roadmap on this? Because of how different browsers handle autofilling with www and without, github pages might as well not work with custom subdomains if the cert doesn’t support BOTH www and apex

Yes, I would like to add my support for this issue impacting me. Please Github, get a fix for this. I talked to the founder of Neocities.org and he got the same issue fixed for me in a day.

Hi Glench! Welcome to the GitHub Support Community!

I’m not sure this will meet everyone’s needs, but I have set up my personal GitHub Pages site to just the domain (without the www subdomain), but with the www subdomain redirecting. To make this work for my domain (galaxyallie.space):

CNAME file is galaxyallie.space
custom domain setting is galaxyallie.space
A records for @ point to 185.199.108.153, 185.199.109.153, 185.199.110.153, and 185.199.111.153
CNAME record for www points to galaxyallie.github.io.

The resulting configuration “just works” in all my testing (please do tell me if there’s a browser that doesn’t handle it well) and www.galaxyallie.space redirects to galaxyallie.space seamlessly.

I know isn’t the same as actually being able to use www but it does take care of warnings in browsers if someone types www or the browser auto-fills it.

2 Likes

One way how to work around this is to migrate your website to GitLab (GitLab is capable to import your entire GitHub repository, including issues and pull requests directly via GitHub API), and then deploy it via GitLab Pages (you will need to add a short YAML file with instructions for the GitLab’s integrated CI/CD to make it work). With GitLab, you can then associate as many domains with your Web site as you wish. All of them can be HTTPS, and they will automatically receive Let’s Encrypt certificate by GitLab.com.

No seriously, it is a shame that GitHub Pages does not support HTTPS for multiple domains, even in 2020. That is a functionality which the competitor offers for years.

1 Like