File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
Expand file tree Collapse file tree 2 files changed +50
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1+ ---
2+ layout : post
3+ title : " github pages 开启 https 及配置 www" "
4+ author: iosdevlog
5+ date: 2019-05-13 21:18:56 +0800
6+ description: " iOSDevLog"
7+ category : 教程
8+ tags : [iOS, www, https]
9+ ---
10+
11+ [ https://help.github.com/en/articles/adding-or-removing-a-custom-domain-for-your-github-pages-site ] ( https://help.github.com/en/articles/adding-or-removing-a-custom-domain-for-your-github-pages-site )
12+
13+ ## 配置 www 域名
14+
15+ [ Setting up a www subdomain] ( https://help.github.com/en/articles/setting-up-a-www-subdomain )
16+
17+ To set up a [ ` www ` subdomain] ( https://help.github.com/en/articles/about-supported-custom-domains/#www-subdomains ) , such as ` www.example.com ` you must configure a ` CNAME ` record with your DNS provider.
18+
19+ > 警告:如果您的域启用了 HTTPS 强制实施,GitHub Pages 的服务器将不会自动路由重定向。您必须使用 www 域名注册商配置子域名和根域重定向。
20+
21+ ![ github pages.png] ( https://upload-images.jianshu.io/upload_images/910914-57093839a0bf4422.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 )
22+
23+ ## 开启 https
24+
25+ [ https://help.github.com/en/articles/securing-your-github-pages-site-with-https ] ( https://help.github.com/en/articles/securing-your-github-pages-site-with-https )
26+ [ https://help.github.com/en/articles/setting-up-an-apex-domain ] ( https://help.github.com/en/articles/setting-up-an-apex-domain )
27+
28+ 1 . 添加 ` A ` 记录,至少有一条 ` A ` 指向以下 ` ip ` 地址。
29+ 1 . 添加 ` www ` 的 ` CNAME ` 记录,指向 github pages 地址。
30+
31+ ``` sh
32+ 185.199.108.153
33+ 185.199.109.153
34+ 185.199.110.153
35+ 185.199.111.153
36+ ```
37+
38+ ![ DNS.png] ( https://upload-images.jianshu.io/upload_images/910914-c9ede9f0f0cdc239.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 )
39+
40+ 如果 ` Enforce HTTPS ` 不可开启,先把 ` Custom domain ` 清空保存,再填入之前的地址,如 ` www.iosdevlog.com ` ,等上 1,2 分钟应该就可以开启 ` https ` 了。
41+
42+ ## 测试一下
43+
44+ 输入 [ www.iosdevlog.com ] ( www.iosdevlog.com ) 和 [ iosdevlog.com] ( iosdevlog.com ) 都会跳转到 [ https://www.iosdevlog.com/ ] ( https://www.iosdevlog.com/ )
45+
46+
47+ ![ iosdevlog.com.png] ( https://upload-images.jianshu.io/upload_images/910914-46ac53c9335d93d3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 )
48+
49+ 参考:[ https://help.github.com/en/articles/using-a-custom-domain-with-github-pages ] ( https://help.github.com/en/articles/using-a-custom-domain-with-github-pages )
50+
You can’t perform that action at this time.
0 commit comments