13

So I had github pages set up with a custom domain without problem on namecheap a day ago. Then I tried switching to Https via github's newly added support for https on pages. After too much frustration I switched over to CloudFlare for Https but I'm now getting an error ERR_TOO_MANY_REDIRECTS

Here's my DNS settings on CloudFlare.

DNS Settings Cloudflare

2
  • you website is working fine at the moment. Do you still have the issue? Did you try another browser?
    – mr4kino
    May 4, 2018 at 14:33
  • Yeah I ended up getting it to work. I had one of my page rules set to redirect to https. Switching the redirect to http fixed it as SSL is set to full on http. May 6, 2018 at 22:33

3 Answers 3

45

Check your SSL setting in the Crypto tab. You should have it set to "Full". If it is set to "Flexible", then Cloudflare will use HTTP to connect to the origin, even when the client browser connects to Cloudflare over HTTPS. GitHub is probably responding with a redirect to HTTPS in this case -- not realizing that the original client is already using HTTPS, and so this redirect creates a loop.

2
  • 5
    Thank you so much!!! This problem has bothered me for hours.
    – Sam Wong
    Jun 24, 2020 at 21:12
  • Thank you for this. I thought I needed to make it lower (Flexible) when it initially wasn't working. However, I discovered in the Pages setting in the GitHub repository said that it was still validating the DNS. Once that was completed, it still did not work until I moxed SSL settings back to "Full".
    – jxn
    Apr 12 at 21:42
3

More info here: https://support.cloudflare.com/hc/en-us/articles/115000219871

The two typical causes of redirect loop errors are:

  • Cloudflare SSL options that are incompatible with your origin web server’s configuration, and
  • Page Rule misconfiguration.
0
-1

you can update in Custom domain github pages https://github.com/yourusername/yourusername.github.io/settings/pages

Custom domains allow you to serve your site from a domain other than xxx.com with www, i was clear this issue with this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.