github pages 開啟 https 及配置 www
https://help.github.com/en/articles/adding-or-removing-a-custom-domain-for-your-github-pages-site
配置 www 域名
To set up a www
subdomain , such as www.example.com
you must configure a CNAME
record with your DNS provider.
警告:如果您的域啟用了 HTTPS 強制實施,GitHub Pages 的伺服器將不會自動路由重定向。您必須使用 www 域名註冊商配置子域名和根域重定向。
開啟 https
https://help.github.com/en/articles/securing-your-github-pages-site-with-https https://help.github.com/en/articles/setting-up-an-apex-domain
- 新增
A
記錄,至少有一條A
指向以下ip
地址。 - 新增
www
的CNAME
記錄,指向 github pages 地址。
185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153
如果 Enforce HTTPS
不可開啟,先把 Custom domain
清空儲存,再填入之前的地址,如 www.iosdevlog.com
,等上 1,2 分鐘應該就可以開啟 https
了。
測試一下
輸入www.iosdevlog.com 和iosdevlog.com 都會跳轉到 https://www.iosdevlog.com/
參考: https://help.github.com/en/articles/using-a-custom-domain-with-github-pages