通过 DNS 的多个 GitHub 页面和自定义域 [英] Multiple GitHub Pages and custom domains via DNS

查看:18
本文介绍了通过 DNS 的多个 GitHub 页面和自定义域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个用户页面和多个项目页面由 GitHub Pages 托管,但在 ONE 自定义域(当然,每个 GitHub Pages 存储库都有子域).所以我的目标如下:

I want to have one user page and multiple project pages hosted by GitHub Pages but available under ONE custom domain (with subdomains for each GitHub Pages repository, of course). So my goals are as follows:

  • One user page (http://florianwolters.github.com) available under http://blog.florianwolters.de, http://www.florianwolters.de and http://florianwolters.de.
  • As many project pages as I wish (e.g. http://florianwolters.github.com/pear available under http://pear.florianwolters.de.

据我目前的理解,GitHub Pages 只允许 CNAME 文件中定义的页面(用户页面和项目页面)的 ONE CNAME 资源记录Git 存储库的根目录.我已经尝试了很多东西(在我的域提供商 EUserv 处处理 DNS 记录和标头重定向,但我只能访问我的一个 URL 下的 GitHub 用户页面 (http://blog.florianwolters.de).我知道 DNS 更改可以最多两天.

As of my current understanding, GitHub Pages do only allow ONE CNAME resource record for a page (both user pages and project pages) defined in the CNAME file in the root of a Git repository. I already tried out many things (playing around with DNS records and header redirects at my domain provider EUserv, but I can only access my GitHub user pages under one URL (http://blog.florianwolters.de). I am aware that DNS changes can take up until two days.

有人可以向我解释一下,我如何才能实现上述目标?我不敢相信这是不可能的,但我也不是 DNS 等方面的专家.

Can somebody explain to me, how I can achieve the goals described above? I can not believe that this is not possible but I am also no expert for DNS, etc.

如果上述方法不可行:您建议的解决方法是什么?我确实想访问一个域(以及该域的子域)下的所有 GitHub 页面.

If the above is not possible: What is your suggested workaround? I do want to access all my GitHub pages under one domain (and the subdomains of that domain).

推荐答案

你可以做到.请注意,所有 DNS CNAME 入口都指向同一主机.

You can do it. Notice that all DNS CNAME entry point to the same host.

1:github.com/florianwolters/florianwolters.github.com

1: github.com/florianwolters/florianwolters.github.com

CNAME 文件内容:blog.florianwolters.de

CNAME file content: blog.florianwolters.de

DNS CNAME:博客 > florianwolters.github.com

DNS CNAME: blog > florianwolters.github.com

2:github.com/florianwolters/pear/tree/gh-pages

2: github.com/florianwolters/pear/tree/gh-pages

CNAME 文件内容:pear.florianwolters.de

CNAME file content: pear.florianwolters.de

DNS CNAME: pear > florianwolters.github.com

DNS CNAME: pear > florianwolters.github.com

这篇关于通过 DNS 的多个 GitHub 页面和自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆