Per the GitHub Pages help page,
You can only have one custom domain for any given set of Pages. If you want multiple domains to point to the same pages, you will need to find a service that can redirect the other domains to your Pages domain.
If you would like to redirect both subdomains (www
and blog
) to username.github.io, you could use your DNS provider to set up a forward (w/o masking) from www
to blog
. Then, if a visitor goes to www.mydomain.com
or blog.mydomain.com
, they'll see the contents of username.github.io
, and the address bar will read blog.mydomain.com
.