For a long time it struggled with a quite major problem in my opinion. It was not supporting HTTPS in combination with a custom domain. Untill your page was hosted under
USERNAME.github.io everything was working fine. However when you wanted to give your page a more tailored and customized look you were faced with a dillema: either do not use HTTPS and get this scary, red lock in your browser’s address bar, or use some tricks involving CloudFlare.
Eventually, in May 2018 GitHub added this lacking functionality and pages with a custom domain can be served over HTTPS. Being a long time user of a custom domain, I felt a slight relief, because I really considered changing to another hosting provider for this reason.
Quite surprisinlgy, the process of turning on HTTPS was not so smooth, so I decided to write it down for future reference.
Here is a step by step guide how to turn on HTTPS in GitHub Pages with a custom domain hosted in OVH. Please, read the points carefully and do not omit any of them. The guide assumes that you are already using a custom domain with GitHub Pages over HTTP.
- In your OVH Web Control Panel, go to the Domains section, select your domain, and open the Redirection tab. Create four, A-type records that point to:
Check if your DNS record is set up correctly by launching
dig +noall +answer example.comin terminal:
dig +noall +answer example.com
example.com. 3600 IN A 126.96.36.199
example.com. 3600 IN A 188.8.131.52
example.com. 3600 IN A 184.108.40.206
example.com. 3600 IN A 220.127.116.11
Remove custom domain from GitHub settings so it falls back to
USERNAME.github.io. This is crucial.
Add the custom domain again. It seems to trigger some inner GitHub procedures that makes it aware of new configuration.
Check, if you can reach your page with the added custom domain over the HTTPS. It should work fine now.
Go back to GitHub and check “Enforce HTTPS for your domain” checkbox.
There you go! :)