Вопрос

I started with GitHub Pages and I don't manage to configure my DNS and my GitHub Repository as I want to.

I would like to redirect both mydomain.com and blog.mydomain.com to username.github.com.

I put mydomain.com in the CNAME file in my GitHub repository and added A records for @ to 204.232.175.78 and two CNAME records for www and blog to username.github.com the URL blog.mydomain.com give me a GitHub 404 error.

What is wrong with my configuration?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top