用github把域名解析到自己的博客

背景

新注册了一个域名,原来的域名还没到期,就把新的暂时解析到我的博客吧。

在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

posted @ 2021-01-30 18:10  HUGBOY  阅读(1010)  评论(1)    收藏  举报