Too many redirects problem

I have activated Cloudflare on one of my websites about 3/4 days ago.

The website was working finely until today when most pages do not load anymore because of too many redirects.

For your information:

  • URLs have not been changed since I have activated Cloudflare
  • most of the URLs do not have any redirect attached to it.
  • As a test, I tried to set a brand new URL on some affected pages but even the new URL has same issue

Any idea what may cause the issue. Some settings on Cloudflare?

If that may be helpful, this is one of the pages affected https://pimpyourpups.com/miglior-cibo-per-cani/

Hi @ramadoriclaudio,

The errors “The page isn’t redirecting properly” or “ERR_TOO_MANY_REDIRECTS” indicates a redirect loop between Cloudflare and your origin server. The easiest fix for this is to remove the redirect on your origin server. For a more detailed set of options, review the troubleshooting suggestions in this Community Tip. If you continue to see issues after trying the Quick Fix Ideas in the Tip, please share the domain name here.

Thanks Domjh for your quick reply.

How do I remove the redirect on my origin server?

Thanks

The redirect seems to be coming from Yoast SEO, is that something you use?

Does your server IP end in `253`? If so, the same happens with or without Cloudflare
$ curl -I https://pimpyourpups.com/miglior-cibo-per-cani/
HTTP/2 301 
date: Mon, 30 Nov 2020 17:44:23 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=d5e5be9d149c84c2d79e142f62e5dd74a1606758260; expires=Wed, 30-Dec-20 17:44:20 GMT; path=/; domain=.pimpyourpups.com; HttpOnly; SameSite=Lax; Secure
x-powered-by: PHP/7.2.34
vary: Accept-Encoding,Cookie
expires: Mon, 30 Nov 2020 18:44:23 GMT
cache-control: max-age=3600
x-redirect-by: Yoast SEO
location: https://pimpyourpups.com/miglior-cibo-per-cani/
content-security-policy: upgrade-insecure-requests
cf-cache-status: DYNAMIC
cf-request-id: 06bbda778e000034f093ac3000000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=O6WSDVm6ARqYGHwURa0hgpfO1%2BMbmVcdGxPvEg4zQEff3Eb5mVyT0sL9mvmaNwO%2BY6XZsg9o7etcH%2Bht9DjnuA1IGG10cndept3Uzy6c8Cr5"}],"group":"cf-nel","max_age":604800}
nel: {"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 5fa66038ea2634f0-DUB
$ curl -I https://pimpyourpups.com/miglior-cibo-per-cani/ --resolve pimpyourpups.com:443:X.X.X.253
HTTP/2 301 
date: Mon, 30 Nov 2020 17:45:03 GMT
server: Apache
x-powered-by: PHP/7.2.34
vary: Accept-Encoding,Cookie
expires: Mon, 30 Nov 2020 18:45:04 GMT
cache-control: max-age=3600
x-redirect-by: Yoast SEO
location: https://pimpyourpups.com/miglior-cibo-per-cani/
content-security-policy: upgrade-insecure-requests
content-type: text/html; charset=UTF-8
1 Like

It’s stuck in an HTTPS redirect loop. Was your site working with HTTPS before you added it to Cloudflare?

Yes, I am using Yoast, and yes I was already using Https before activating Cloudflare

I don’t think this is anything with Cloudflare, you will probably need to look into why Yoast is doing this redirect.

1 Like

Never happened before activating Cloudflare. However, the issue started only today, the website was completly fine even with Cloudflare activated

If you want to check, you can pause Cloudflare, wait a few minutes and see if the issue remains.

You can pause Cloudflare from the Overview tab of the Cloudflare Dashboard, bottom right under Advanced Actions.

If the issue persists after Cloudflare has been paused, it means that there is an issue with your origin, Cloudflare is only operating as your DNS provider while it is paused.

Thanks, I will try

I think I have found the problem.

I paused Cloudflare and the problem persisted.

On Yoast, I set the Remove the categories prefix setting to “Keep” and now the website is working.

Not sure how the issue happened since I didn’t changed this setting before.

In any case, thanks a lot, your help was truly precious.

2 Likes

Fantastic, I’m glad you managed to get it resolved. No problem! :slight_smile:

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.