【问题标题】:can I create a subdomain for my github pages site?我可以为我的 github pages 站点创建一个子域吗?
【发布时间】:2021-03-22 14:35:56
【问题描述】:

例如,我有这个 github pages 站点:foobar.github.io

我有一个名为 repo 的存储库,我想为它创建一个子域,如下所示:repo.foobar.github.io

这可能吗?我该怎么做?

当我想选择 repo.foobar.github.io 作为 repo 的 github 页面设置的自定义域时出现此错误:

 You cannot use CNAMEs ending with github.io, github.com, or github.page. Instead, create a repository named AshkanLaei.github.io. See https://docs.github.com/articles/setting-up-your-pages-site-repository/ 

【问题讨论】:

    标签: git github repository subdomain github-pages


    【解决方案1】:

    不,你不能。

    由于您不拥有/控制 github.io 域及其 DNS 设置,因此您无法进行设置。而且他们不允许您进行设置。

    您可以选择使用子目录而不是子域。它们确实允许您拥有 foobar.github.io/anotherrepo

    之类的东西

    有关 GitHub Pages 站点类型的更多信息:

    https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites

    有关 GitHub Pages 站点的自定义域/子域的更多信息:

    https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/configuring-a-custom-domain-for-your-github-pages-site

    【讨论】:

      猜你喜欢
      • 2017-04-08
      • 2013-03-21
      • 2011-09-26
      • 2021-12-11
      • 2015-02-24
      • 2013-05-03
      • 2015-12-11
      • 1970-01-01
      相关资源
      最近更新 更多