new DNS setting

我的需求: www.gewill.org 跳转到 gewill.org。

使用万网域名服务提供的 DNS 解析需要备案才能实现301跳转,所以之前使用 DNSPOD 的服务,但是不知为何竟失效了,gewill.org 能打开,www.gewill.org打不开了。换了其他的也都不行,dig 也是对的。

Google Github Pages 的相关信息,发现官方帮助文档就有简单是实现方案:

Configuring a www subdomain

If you configure both an apex domain (e.g. example.com) and a matching www subdomain (e.g. www.example.com), GitHub’s servers will automatically create redirects between the two.

For example:

If your CNAME file contains example.com, then www.example.com will redirect to example.com.
If your CNAME file contains www.example.com, then example.com will redirect to www.example.com.”

DNS 同时 CNAME 顶级域名和 WWW,然后在 Github CNAME文件中添加偏好的一个。

虽然之前有看过,一则英文看了只解一二,二则当时对于 DNS 和网站都刚刚接触。我学习新鲜东西节奏还是太慢,以后还要多思考,多与人交流。官方文档还是最简洁正确的。