参考:GitHub Page Custom Domain - www is redirected to https
1.在namecheap上设置为
A Record | @ | 192.30.252.153 |
---|---|---|
A Record | @ | 192.30.252.154 |
CNAME Record | www | username.github.io |
以上除了username
其他的都可以不改变,至于网上有人说需要ping
IP的,我没有试过这样,亲测可行。
2.在本地设置
在soruce
新建文件CNAME
,必须是大写。打开文件输入username.github.io
,保存。
然后想往常一样重新部署一下123hexo cleanhexo ghexo d
然后去冲杯咖啡,回来就可以用独立域名访问你的网站了。