Custom HTTPS domain on Github Pages with CloudFlare
Prepare
- Register a account on CloudFlare and buy a domain.
- Make sure you have created your Blog on Github Page. If you haven’t started a Blog yet, check out the previous post.
CloudFlare
- Goto your domain.
- Goto DNS page.
- Add two record,
A
&CNAME
TheName
inA
is your domain name (xxx.com). TheContent
inA
is your Github Page’s IP, and you can opencmd
and enterping
to get the IP.
TheName
inCNAME
is www. TheContent
inCNAME
is your Github Page. - Goto SSL/TLS > Edge Certificates page, and check
Always Use HTTPS
Github Page
- Goto Setting > Pages, and enter your domain in
Custom domain
and Save.
Final
- Open the Blog folder and goto the
source
folder.
- Create a
CNAME
file under thesource
folder.
- As shown, enter your domain name.
- Finally,
hexo g
andhexo d
were re-uploaded to Github.
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.