【发布时间】:2022-02-01 16:38:50
【问题描述】:
这似乎应该是一项微不足道的任务,但事实证明对我来说并非如此......
我应该如何将多个域名指向同一个 GitHub Pages 托管站点?
例子:
我在 GitHub 上创建了一个名为 test 的帐户,并创建了一个存储库 test.github.io
我买了test.com
我将 test.com 的 DNS 配置如下
我已经告诉 GitHub Pages 强制执行 https 并注意自定义域 test.com
我的网站现在在 test.com 和 www.test.com 上运行,哇哦!
test.com 的 DNS 配置:
A @ 185.199.108.153(github 的域名服务器)
A @ 185.199.109.153(github 的域名服务器)
A @ 185.199.110.153(github 的域名服务器)
A @ 185.199.111.153(github 的域名服务器)
CNAME @ www.test.github.io(用于 www 重定向)
我还希望将 example.com(以及其他一些域,foo.com、bar.com 和 foobar.com)重定向到 test.com
我该怎么做?
使用 apache 服务器,这很容易,因为 GitHub Pages 只支持静态站点。
有什么想法吗?
一如既往,感谢您的任何建议!
【问题讨论】:
标签: dns github-pages website-hosting