404 error only with custom domain


I’m trying to use a custom domain with my personal Github site, building it with Jekyll. The site loads fine when I access patreeceeo.github.io but I get a 404 with my custom domain, let’s say xyz dot com. The situation may be complicated by the fact that I had used this domain with a previous repository on Github and the process of removing it from the old repo and adding it to the new one seemed glitchy: When I went in to the settings on the old repo and hit the remove button on the custom domain I got a 404 page, so then I simply deleted the CNAME file (contents: xyz dot com) from the repo. I then committed a CNAME (contents xyz dot com) to the new repo. The custom domain never showed up in the settings for the new repo, however.

Here’s what else I’ve done:

I’ve followed all the steps in configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site.

I’ve set the full url including https:// in the Jekyll _config.yml file.

I created a test.html and tried to load xyz dot com/test.html, as suggested in this post: github.community slash after-adding-custom-domain-there-are-now-404-errors-using-google-and-project-pages/10636, but that also 404s.

also sorry for the weird links, had to break them because the forum wouldn’t let me post w/ more than 2 links as a new user

Solved! I think what did it was deleting the CNAME file from the new repo then entering the custom domain in the repo settings, which apparently triggered some background processing on Github.

Further details: To clarify, the old repo was created when I had a different user name on Github several years ago, that’s how I ended up with two repos. When I tried to set the custom domain in the new repo via settings I got an error about that domain already being used by the old repo. I tried simply removing the custom domain from the old repo but that was glitchy, as I mentioned above.

Also I deleted the old repo on Github before doing what I think was the solution, not sure if that was necessary.

Also I guess I was somehow under the impression that simply committing a CNAME file would be the same as adding the custom domain in the settings. Not sure if that’s in the docs or if I made that up.