我目前有username.netlify.com我的网站。内容存储在私有 gitlab 存储库中,并通过 netlify 提供/部署。
我还username.rbind.io为自己注册了免费的。但显然这被一些公司防火墙阻止了。
我想要的是username.github.io从 netlify 使用和服务该站点,但将我的文件在 gitlab 中保密。
在 netlify 中,我添加了一个自定义域username.github.io,然后出现Check DNS configuration警告,上面写着
DNS configuration
Point username CNAME record to username.netlify.com
Log in to the account you have with your DNS provider, and add a CNAME record for username pointing to username.netlify.com.
username CNAME username.netlify.com.
If you’ve already done this, allow up to 24 hours for the changes to propagate, or check our documentation for more information.
我已将一个文件添加到我的存储库CNAME的根目录中。username.github.iousername CNAME username.netlify.com
但现在我收到一封电子邮件说
The page build completed successfully, but returned the following warning for the `master` branch:
The CNAME `usernamecname username.netlify.com.` is not properly formatted. See https://help.github.com/articles/troubleshooting-custom-domains/#github-repository-setup-errors for more information.
最终,我想进入username.github.io,我应该让我的静态站点由 netlify 提供服务。
我尝试使用netlify.toml. 因此它重定向到我的rbind.io域,但这不是我想要的。我想username.github.io在我的浏览器地址栏中查看我的网站。
netlify.toml
[[redirects]]
from = "https://username.netlify.com/*"
to = "https://username.rbind.io/:splat"
status = 301
force = true