Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I have a setup where tshepang.github.com redirects to tshepang.net, and have set up my A record to point to 204.232.175.78 (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.

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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 '13 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 '13 at 10:51
    
I've tried with 9 sub-domains, and it works. It takes a while though... several minutes for each sub-domain. –  Tshepang Apr 14 '13 at 11:22
    
@Tshepang Wow, you just created the respective repositories and it all works? –  Hydra Apr 14 '13 at 11:23
    
yes sir, indeed it does –  Tshepang Apr 14 '13 at 11:24
up vote 1 down vote accepted

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.

share|improve this answer
1  
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 '13 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 '13 at 21:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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