I have a project site in Github that is served through a custom domain (rented through Google Domains). I first configured the repository to serve directly from the master
branch, and configured the DNS records in Google accordingly.
Specifically, the A
record is set to
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
and the CNAME
record is set to myusername.github.io
. In the Github repository, I created the CNAME
file with mycustomdomain.org
and changed the repository settings to use it. This works properly.
However, once I change the Github Pages setting to use the /docs
folder on the master branch, I can't access the site through mycustomdomain.org
. (It's a 404 error) Intuitively, it's now at mycustomdomain.org/docs
. Is there any way to both serve the pages from the docs
folder and access the site through the top-level domain?
Moving CNAME file from the root of the repo to the /docs
folder solved the problem.
Reference: The CNAME errors
are mentioned here in GitHub documents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With