I have a setup where tshepang.github.com redirects to tshepang.net, and have set up my A record to point to (as explained). It works well.

Now, I want to have a subdomain, so I can have a CNAME record pointing to movies.tshepang.net. Since tshepang.github.com is already taken, I don't know how to do it, short of creating another GitHub account.

3 Answers 3


Yes, it is possible to have multiple GitHub Pages sites within one account. Create another GitHub repository and push your site files to the gh-pages branch. This would result in the site being hosted at tshepang.github.io/<repo-name>.

Now, push another file "CNAME" to the same repository and branch and fill it with movies.tshepang.net. Log in to your DNS host and add the CNAME to point to "tshepang.github.io" (just like the original site).

This would allow you to have seemingly two different sites on different domains. This would not work for having two or more sub-domains within github.io itself.

  • Why the limitation, ...would not work for having two or more sub-domains within github.com itself? Is there a reference somewhere?
    – tshepang
    Apr 3, 2013 at 14:10
  • 1
    I can't really find anything that explains it, I only found out through experience. You can try creating another repository with another sub-domain and see if it works.
    – Hydra
    Apr 5, 2013 at 10:51
  • 1
    I've tried with 9 sub-domains, and it works. It takes a while though... several minutes for each sub-domain.
    – tshepang
    Apr 14, 2013 at 11:22
  • @Tshepang Wow, you just created the respective repositories and it all works?
    – Hydra
    Apr 14, 2013 at 11:23
  • 1
    Yep, indeed. Still works fine, and even works with https! :) Thanks a lot @Hydra! Feb 28, 2020 at 20:55

As mentioned, for each site that would end up accessible as a sub-domain:

  • I need to create a separate GitHub repository
  • Ensure to have the desired site url in the CNAME
  • git push the site onto gh-pages branch

To make those sites accessible from the internet, my settings look like this:

enter image description here

Now, movies.tshepang.net takes me to one site, demo-icbu.tshepang.net takes me to another, and so on.

  • 2
    Sorry, how is this different from my answer? I am referring to having domains like foo.github.io AND bar.github.io all under a single account. You can have unlimited sub-domains if you use your own domain name and add the relevant CNAMES.
    – Hydra
    Apr 14, 2013 at 12:58
  • Using the web interface, I could not get CNAMEs to work. By add relevant CNAMES, do you mean the text files required by GitHub? Also, I don't understand what you mean by foo and bar... I thought one can only have one of either (in my case tshepang.github.io).
    – tshepang
    Apr 14, 2013 at 21:23
  • Is there maybe a video tutorial explaining this. Does it work for multiple sites as opposed to subdomains and multiple sites that might include a subdomain too? site.com, site2.com, sub.site2.com etc etc? Jan 17, 2018 at 20:01
  • I see only master branch and no gh-pages branch is present
    – krishna
    May 23, 2020 at 15:51

I know that this is answered for some time already, but you can even have multiple pages within the same repository. See my answer on Stackoverflow - https://stackoverflow.com/a/41879114/1297835

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.