Multiple GitHub Pages and User Domains via DNS

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

As in my current understanding, GitHub pages only record the CNAME ONE CNAME resource for the page (both user pages and project pages) defined in the CNAME file in the root directory of the Git repository. I already tried a lot of things (playing with DNS records and redirecting headers from my EUserv domain provider , but I can only access my GitHub user pages under the same URL ( http://blog.florianwolters.de ). I know That DNS changes can take up to two days.

Can someone explain to me how I can achieve the goals described above? I cannot believe this is not possible, but I am also not a specialist in DNS, etc.

If the above is not possible: what is your recommended solution? I want to access all my GitHub pages in one domain (and subdomains of this domain).

Resources

+64
github subdomain dns github-pages cname
May 21 '12 at 13:14
source share
2 answers

Can you do it. Note that the entire DNS CNAME record points to the same host.

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

CNAME file content: blog.florianwolters.de

DNS CNAME: Blog> florianwolters.github.com

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

CNAME file content: pear.florianwolters.de

DNS CNAME: Pear> florianwolters.github.com

+61
May 22 '12 at 12:44
source share

You can either use the CNAME resource resource alone , or one recording resource along with GitHub Pages .

So, in conclusion, you need to decide:

  • Or you use example.org and www.example.org (replace existing A record with 204.232.175.78 ) ...
  • ... or a subdomain, for example. blog.example.org (create a new CNAME using <username>.github.com ).

Now you need to choose a method of transition from one (additional) domain to another:

  • At first use, you can use redirects using the HTTP headers from the desired subdomain (s) to example.org .
  • When using the latter, you should use header redirection from example.org and www.example.org to the desired subdomain (s).

Also see GitHub Pages Help for reference and GitHub Pages Repository for an example CNAME file.

Edit: GitHub pages have added a detailed page that describes how to set up a custom domain here .

+5
May 26 '12 at 13:32
source share



All Articles