So I have an organization created in Github and I created a project in that organization. Now I can create the site for this project by creating the branch gh-pages and pushing the html files here. I want to point a subdomain to this github pages site. For example, I have a domain called testdomain.com and I want app.testdomain.com should point to github pages located at http://orgname.github.io/app

I went through the documentation but I can't understand how to make this redirect. Any leads will be helpful.


You can't redirect to the level you are talking about. You can CNAME the GitHub pages service, and the project pages (through a gh-pages branch) will exist under it but DNS is based only on domain name and there isn't an option to target it to what amounts to a sub folder of the site. Best thing you could do in this instance would be to create a repo orgname.github.io and create an index page in that with a prominant link to the gh-pages sub directory. You could do this with a meta refresh targeting the sub directory but it would have to load to the first page before being refreshed into the new directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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