githubgithub-pagesgodaddy-api

Infinite Redirect between GitHub and GoDaddy


I'm having an issue with a website that I am hosting on GitHub with a Domain from GoDaddy.

The site is located at griftertheband.com

Sometimes, I get the "Safari can't open the page because too many redirects occurred" message when I try to access the site on my iphone. In the Chrome browser, I get teh error "This page isn’t workingjon424.github.io redirected you too many times."

I have followed the instructions for "Managing a custom domain for your GitHub Pages site" found in the GitHub docs here: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site.

The code for the site lives on GitHub. It is a fairly simple repo here: https://github.com/jon424/grifter with the following structure:

/img
about.html
favicon.ico
index.html

Under GitHub Pages, I see that my site is live at http://griftertheband.com/

Under Custom Domain, I have "griftertheband.com" There is a message that says "DNS Check in Progress", which is strange because I know that this check was successful in the past, it just seems that it is stuck in the "checking" process right now:

enter image description here

On the GoDaddy side, I have a lot of DNS Records for griftertheband.com. This is what my DNS records page looks like (three screenshots for pagination):

enter image description here

enter image description here

enter image description here

Does it look like I'm missing anything that could prevent this infinite re-direct from happening? Thanks for any info.


Solution

  • There are a few things happening, but I am pretty sure you missed this part of the docs:

    To publish a user site, you must create a repository owned by your personal account that's named .github.io.

    I see you have a repo named https://github.com/jon424/jon424.github.io. To explain what's happening:

    If you access jon424.github.io directly, it serves the content from jon424.github.io. I can see this is working from an older project.

    If you access jon424.github.io/pizza, GitHub will check jon424.github.io for a pizza folder. If it finds one, it will serve content from there. If it does not find one, which is what's happening here, it will check for a repo named pizza owned by user jon424.

    Since it found one, it will serve content from there. It also looks for a CNAME file, and it finds one, which redirects it to griftertheband.com.

    Your DNS settings have a CNAME which redirects to jon424.github.io. By requesting griftertheband.com, your request is redirected through GitHub's service, which attaches the /griftertheband URI since your original request was for griftertheband.com. Upon reaching it, it then redirects back to griftertheband.com.

    I don't know exactly what your issue is, because the DNS pictures you've attached are a bit confusing - I don't know what half of that stuff is. But I noticed that https are getting redirected to http and you may have set that up incorrectly.

    I would try to take a step back and try:

    1. Delete the jon424.github.io repo (archive the project under a different name if you want to keep the music theory quiz code around)
    2. Delete the grifter repo, move its code to a new jon424.github.io repo.
    3. Remove ALL your DNS settings for griftertheband.com
    4. Set up an A record from your DNS provider pointing griftertheband.com to jon424.github.io
    5. Do not worry about the www CNAME yet, verify that https://griftertheband.com returns the page in the GitHub repo and that griftertheband.com does too (and uses https). If it's redirecting to http://griftertheband.com then figure out how to get that working next.
    6. Add back the www CNAME (if desired, I think www is on the way out and does not really need to be supported) and verify that https://griftertheband.com, https://www.griftertheband.com, griftertheband.com, and www.griftertheband.com all resolve to https://griftertheband.com and serve the correct content.
    7. Add back your other DNS settings if they are needed for other services.

    dig example