How to Use Your Own Domain For Github Pages

git

A Github Pages site is great for hosting a git project’s website but can also be used for your own personal site if you like. It is pretty easy to setup and is free. The url of the site will be username.github.io which seems fine. This site is hosted on Github Pages and I have been pretty pleased with it in particular as https is always forced.

Browsing over the doco the other day I noticed that you can use your own domain with subdomain which sounded interesting. The details for setting this up are here - simple stuff if you can change your domain’s DNS records. The output dig output should look something like the following for my blog :

ewan$ dig blog.ewanharrow.com +nostats +nocomments +nocmd

; <<>> DiG 9.10.6 <<>> blog.ewanharrow.com +nostats +nocomments +nocmd
;; global options: +cmd
;blog.ewanharrow.com.		IN	A
blog.ewanharrow.com.	300	IN	CNAME	eharrow.github.io.
eharrow.github.io.	2731	IN	A	185.199.108.153
eharrow.github.io.	2731	IN	A	185.199.109.153
eharrow.github.io.	2731	IN	A	185.199.110.153
eharrow.github.io.	2731	IN	A	185.199.111.153

However https://blog.ewanharrow.com ended up with a github error page. A little further reading said that I needed to enable the custom domain on the github pages and voila https://blog.ewanharrow.com now works once you add the custom domain name and check the https box.

github-pages-config screenshot