如何使用 github Pages 域名并将其指向 netlify 托管的网站?

问题描述 投票:0回答:1

我目前有

username.netlify.com
作为我的网站。内容存储在私有 gitlab 存储库中,并通过 netlify 提供/部署。

我还为自己注册了

username.rbind.io
,这是免费的。但显然这被一些公司防火墙阻止了。

我想要的是使用

username.github.io
并从 netlify 提供该网站,但将我的文件保存在 gitlab 中私有。

在 netlify 中,我添加了一个自定义域

username.github.io
,并且显示了 检查 DNS 配置警告,其中显示

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.io
存储库的根目录中,其中包含
username 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
github github-pages netlify
1个回答
0
投票

想知道你是否曾经让它发挥过作用?我也想要同样的东西

© www.soinside.com 2019 - 2024. All rights reserved.