GitHub Pages – How to Publish More Than One Site

domaingithub

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.

Best Answer

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.