1 min to read
How to SSL-secure my GitHub Pages Jekyll blog
How to SSL-secure my GitHub Pages Jekyll blog

Good news â GitHub Pages already provides free SSL (HTTPS) automatically for all custom domains and default .github.io domains. You just need to make sure your configuration is correct.
Hereâs how to make your Jekyll blog fully SSL-secure:
1. If Youâre Using the Default GitHub.io Domain
If your site is something like:
https://username.github.io
â GitHub Pages automatically enables HTTPS for it.
To confirm:
-
Go to your repository on GitHub.
-
Click Settings â Pages.
-
Under âCustom domainâ and âEnforce HTTPSâ, ensure âEnforce HTTPSâ is checked.
Thatâs it â your site will always redirect to HTTPS.
2. If Youâre Using a Custom Domain
If youâre using a domain like www.yoursite.com or blog.yourbrand.co.ke, follow these steps:
Step 1: Configure DNS Correctly
In your DNS provider (e.g., Cloudflare, GoDaddy, Namecheap), add:
A Records (for apex domain e.g., yoursite.com):
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
CNAME Record (for www):
www â yourusername.github.io
(Replace yourusername with your GitHub username.)
Step 2: Add Your Custom Domain in GitHub
-
Go to your repo â Settings â Pages
-
Under Custom domain, enter your domain (e.g., www.yoursite.com)
-
Click Save
GitHub will verify your DNS and automatically issue an SSL certificate (via Letâs Encrypt).
Step 3: Enforce HTTPS
Once the certificate is ready (can take a few minutes or hours):
-
Check the âEnforce HTTPSâ box under Settings â Pages.
-
Test your site:
-
Visit both http:// and https:// versions.
-
It should automatically redirect to HTTPS.
đ 3. Force HTTPS Redirects in Jekyll (Optional)
Even though GitHub usually handles redirects, you can force it manually by adding this to your _config.yml:
Comments