背景
新注冊了一個域名,原來的域名還沒到期,就把新的暫時解析到我的博客吧。
在GitHub創建倉庫
登錄后新建倉庫
倉庫名為your_username.github.io
,其中your_username為你的github賬號名。
在倉庫中創建一個index.html文件
代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script>
window.location.href = "https://www.cnblogs.com/hugboy/"
</script>
</body>
</html>
https://www.cnblogs.com/hugboy/
改為你的博客地址
現在訪問your_username.github.io可以訪問到你的博客。
萬網域名解析
選擇CNAME
記錄類型(跳轉到另一個域名),域名解析指向your_username.github.io
配置Github page接受阿里雲解析
找到[Settings]--->[GitHub Pages]填入你的域名並[Save]即可
參考
https://www.cnblogs.com/package-java/p/10419206.html
https://www.cnblogs.com/boxy/p/10730232.html