How I fixed the WordPress installation on my web hosting service when it had a wp-admin redirect loop. I’m sharing this in hopes it will save hours of time for others.
First, I had registered a new domain name using the Cloudflare Registrar, which is one of the very few domain registrars that has at-cost pricing for registration and renewal. Then I setup my new domain name to point to the web hosting shared IP address by adding a DNS A record.
I did a fresh installation on my web hosting service (inmotionhosting.com) using Softaculous, and that was very easy. I was able to go to my new website (or new blog) home page, and see everything a-okay. However, but I got this redirect loop error message when I tried to go to example.com/wp-admin where I would normally go to login for the WordPress Admin Dashboard.
And, depending on your web hosting, you might have 1 of these 2 error messages:
We apologize for the inconvenience, but this page is currently unavailable. Please check back again later.
429 Too Many Requests
The requested URL is rate-limited and has received too many requests within a short amount of time.
How I fixed the redirect loop for WordPress Admin and a Domain Registered at Cloudflare
I found more than a handful of articles with troubleshooting tips to fix the redirect loop on WordPress like at here and here and here. Those tips may fix other people’s WordPress situation, but it did not fix mine.
What I had to do was go back to the Cloudflare admin dashboard and turn off proxy for the 2 DNS records that pointed to my web hosting server.
Then I made a new installation of WordPress via Softaculous. Went all the way through to the admin link example.com/wp-admin and made sure everything was working. Then, and only then, I went back to the Cloudflare admin dashboard and turn ON proxy for those 2 DNS records.
Why did this make a difference, a big difference? It has something to do with how SSL works from a user’s web browser to the Cloudflare DNS and that goes to the web server. When that SSL connection is proxied by Cloudflare (instead of directly connected, without proxy), the WordPress admin and web server and SSL status gets confused and messed up or something that makes it not work. Hope this was helpful.
Fix For Redirect Loops on WordPress with CloudFlare’s Flexible/Universal SSL