gpt4 book ai didi

subdomain - 一个 CNAME 文件用于 2 个不同的域。 gh-pages X namecheap

转载 作者:行者123 更新时间:2023-12-01 13:45:13 24 4
gpt4 key购买 nike

我在 GitHub 上有一个项目,它存在于一个私有(private)存储库中,我不是它的所有者而是合作者,它是我 friend 的存储库。

我的目标是为我们的网站制作一个登陆页面,因此,当我们从 NameCheap 购买域名时,我关注了 this tutorial .

问题是,我们有两个域,一个是 swopular.de,另一个是 swopular.com

我的想法是像这样将它们都放在 CNAME 文件中:

CNAME

swopular.de
swopular.com

但是现在当我尝试访问该站点时出现以下错误:

404

There isn't a GitHub Pages site here.

If you're trying to publish one, read the full documentation to learn how to set up GitHub Pages for your repository, organization, or user account

我在上面发布的教程中引起我怀疑的是这一步,在 NameCheap 服务器上我应该...

Here you will need to create three records for your domain: 

- A record for @ pointing to 192.30.252.153
- A record for @ pointing to 192.30.252.154
- CNAME record for www pointing to your username.github.io (username should be replaced with your actual GitHub account username):

我把 username.github.io 放在我想为其创建站点的项目实际上存在于存储库中,该存储库是该存储库的子域 - 但 NameCheap 不允许我输入子域到那个字段,比如 username.github.io/XXX

也许在网络开发方面有更多经验的其他人可能知道我该如何解决这个问题?

最佳答案

Github Pages 的CNAME 文件只支持1 个CNAME。 ( https://help.github.com/articles/about-supported-custom-domains/ )

我建议您选择一个域作为主要域。由于 de 是国家/地区特定的 TLD,而 com 是通用的,因此我会选择 com

要允许您的域托管在 www.swopular.com 并将 swopular.com 重定向到 www 子域,CNAME 文件应该只包含 www.swopular.com。与之关联的 DNS 记录应该是您提到的那些,

- A record for @ pointing to 192.30.252.153
- A record for @ pointing to 192.30.252.154
- CNAME record for www pointing to your username.github.io (username should be replaced with your actual GitHub account username):

服务器端应注意将附加扩展名添加到 CNAME 记录,仅在 CNAME< 中包含 [username].github.io/code> 记录

对于 de 域,我建议使用 Namecheap 的 HTTP 重定向服务。 ( https://www.namecheap.com/support/knowledgebase/article.aspx/385/77/how-do-i-set-up-a-url-redirect-for-a-domain ) 然后您可以将根 dewww.swopular.de 重定向到 www.swopular.com

关于subdomain - 一个 CNAME 文件用于 2 个不同的域。 gh-pages X namecheap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36463530/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com