DEV Community

Discussion on: Looking for help fixing github-hosted custom domain's CNAME

Collapse
 
chuck_ha profile image
Chuck Ha • Edited

You can't have multiple domains in the CNAME file in github: help.github.com/articles/troublesh...

I think the problem is with the CNAME record in google domains. You want it to point to username.github.io. without the /projectname. That way, if you go to www.example.com the DNS record will redirect you to example.com and you should be good to go 👍🏼

note that DNS propagation can be slow so it might take some time!

Collapse
 
stacy profile image
Stacy Montemayor

hmmm... I thought the "www" was a subdomain?? Also, if I don't list the repository name in the google CNAME, how would it know to point to this particular repository? (I have one other repository set up to be hosted with github pages, but don't have an actual website there yet.)

I'm kind of thinking I might do a subdomain redirect on google domains where I redirect example.com to example.com It feels kind of hacky but I think it would work.

Collapse
 
chuck_ha profile image
Chuck Ha

www is a subdomain. Yeah, your suggestion would work. Otherwise, I'd probably get rid of the CNAME file entirely and follow help.github.com/articles/setting-u... this very closely. Good luck!

Thread Thread
 
stacy profile image
Stacy Montemayor

I dropped the repository name on google and it worked! I don't really understand why, but expect one day three weeks from now I'll actually understand. Thank you thank you!!