I have two projects on Github which both belong to the same Github "organization". Both projects have a gh-pages branch which I'd like to serve under a custom subdomain. Configuring this correctly turns out to be quite hard, despite several Github documentation pages and helpful SO posts such as this one.
Here's what I have so far:
DNS Configuration
- proj1.mydomain.com has a CNAME record pointing to 
org.github.io. - proj2.mydomain.com has a CNAME record also pointing to 
org.github.io. 
nslookup proj1.mydomain.com returns:
Name:     github.map.fastly.net
Address:  185.31.17.133
Aliases:  proj1.mydomain.com
          org.github.io
For proj2, the alias says proj2.
Github Setup
org/proj1 has a gh-pages branch with a CNAME file on it that says
proj1.mydomain.com
For proj2, the CNAME file says proj2... as well.
The organization has no special configuration or website, as we only care about the two projects.
Behavior
org.github.io/proj1/: Content OK, but no redirect toproj1.mydomain.comorg.github.io/proj2/: Content OK, but no redirect toproj2.mydomain.comproj1.mydomain.com: works OKproj2.mydomain.com: works OK
How can I get that redirect to work as it should?
The apex domain mydomain.com (just like www.mydomain.com) is not involved in all of this; I currently have subdomains and Github projects only. Also, I do see the Your site is published at http://proj1.mydomain.com message as suggested by the Github docs.