github - 当已经拥有自定义 CNAME 时,是否可以在多个存储库上使用 Github 页面?

标签 github github-pages

我设置了一个 Github 存储库来托管一个小型静态站点。托管它的存储库采用以下格式:

username.github.io

此存储库设置为使用 custom domain并且有一个 CNAME 文件可以正确执行此操作。该存储库完全按照预期工作。

现在我想设置一个project page并将 gh-pages 分支用于不同的存储库。但是,当我这样做时,第一个存储库中的 CNAME 似乎适用,并且我被重定向到 example.com/REPOSITORYNAME 而不是使用预期的 username.github.io/projectname code> 与此单独的存储库关联。


如何继续使用具有自定义域的 username.github.io 存储库不同的 gh-pages 分支存储库而不将 gh-pages 存储库重定向到第一个存储库中定义的自定义域?

最佳答案

截至 2016 年 8 月,我认为这是不可能的。 (https://help.github.com/articles/custom-domain-redirects-for-github-pages-sites/)

Github Pages 帮助文章指出

Project Pages site owned by a user account, such as username.github.io/projectname, will be Automatically redirected to a subdirectory of a User Pages site custom domain (user.example.com/projectname), unless a different CNMAE is specified, such as project.example.com

参见Github pages - Disable custom domain redirection for all but a single site?

关于github - 当已经拥有自定义 CNAME 时,是否可以在多个存储库上使用 Github 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38874742/

相关文章:

git - 在 Git 中不断提示输入 SSH 密码

将提交推送到 github 时 Git 失败

Jekyll Github Action 停止工作,现在失败并显示错误消息 : "Cannot publish on branch master"

github - 为什么我自己的 GitHub 页面不显示我的项目?

html - 图片没有显示在 Github Pages 中?

rubygems - 无法创建新的 jekyll 站点 : "Could not locate Gemfile or .bundle/directory"

android - 这个字段怎么注入(inject)github android?

git - Perl 脚本在 tom cat 6.0 上变慢并产生服务超时

git - "This branch has conflicts that must be resolved"但它已经 merge

github-pages - 个人网站的 GitHub 页面。如何部署文件夹