Search code examples
githubgithub-pagescname

Github pages - Disable custom domain redirection for all but a single site?


I've been using github pages since a long time and use the custom domain redirection feature to redirect my user website from prahladyeri.github.io to my own domain which is https://www.prahladyeri.com by adding a CNAME file.

However, for the web-pages (gh-pages branch) of open source projects that I maintain, it automatically redirects a foo project to www.prahladyeri.com/foo when no CNAME is specified. Is it possible to use the default prahladyeri.github.io/foo scheme for my projects, but keep custom redirection on for my main site?

Is that something easily achievable?

Update on 2022-11-14

As of today, I've switched to the proper sub-domain https://prahladyeri.github.io. The old site will soon expire, I'm keeping this post only for academic interest.


Solution

  • As of Jul 2016, I don't think this is possible. (https://help.github.com/articles/custom-domain-redirects-for-github-pages-sites/)

    The Github Pages help article states that

    Project Pages site owned by a user account, such as username.github.io/projectname, will be Automatically redirected to a subdirectory of a User Pages site custom domain (user.example.com/projectname), unless a different CNMAE is specified, such as project.example.com