简体   繁体   中英

Setting up custom https sub domains with github pages?

If we want the custom domain example.com with our github pages, then we just go into settings and add example.com , and assuming that we have already added the A records for @ to our domain name registrar this just works IIUC.

Now if we also want a subdomain sub.example.com for another github repository do we enter sub.example.com in the repository settings panel for the custom domain? I assume this is all we have to do, assuming the A records for sub have already been setup?

I've tried it out and post doing it I get this github message:

Your site's DNS settings are using a custom subdomain, sub.example.com, that's set up as an A record. We recommend you change this to a CNAME record pointing at [YOUR USERNAME].github.io. For more information, see https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/ .

Why is github recommending this? There is a reference URL included in the message, but it's a link to generic instructions on how to setup github custom domains, and there's nothing specific with respect to sub domains.

The message from GitHub is very clear, and according to its document:

You can set up a custom subdomain, such as blog.example.com, by creating a CNAME record through your DNS provider.

That is, you should use CNAME record, not A record, and point it to [YOUR USERNAME].github.io.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM