【发布时间】:2022-11-28 10:48:52
【问题描述】:
我正在使用 Github 页面进行托管。域名便宜的 DNS。
我想要如果去“example.com”将网络浏览器请求发送到 ->“blog.example.com。”
我能够在 github 页面上为 blog.example.com 创建和验证自定义域并且它有效,但不了解如何将 apex 根域重定向到 blog.example.com。
回顾: 自定义 github 页面域:blog.example.com && Namecheap:CNAME 博客 => example.github.io。
我尝试删除所有建议的 github A、AAAA 记录并尝试使用 URL redirect/301,还尝试了别名记录
"@" -> blog.example.com
URL 重定向似乎导致超时,而别名记录似乎导致使用 404 转到 github。
似乎这些是相关的 github 页面文档: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain
我看过这个无济于事。
难道我做错了什么?
附带问题:我不确定 github 目录中是否需要 CNAME 文件,因为我觉得它或多或少用于文档? (更改此文件似乎没有任何效果。)
【问题讨论】:
标签: redirect dns github-pages cname namecheap