Better solution to prevent Wordpress ERR_TOO_MANY_REDIRECTS (only appearing at wp-admin)?
Is there a way to prevent this error, ERRTOOMANY_REDIRECTS from appearing at /wp-admin after certain common installation conditions (described below). Here is what I did:
I pointed my DNS to Cloudflare.
Then on Cloudflare I created an A Record (@) pointing to my Digital Ocean droplet IP address, as well as a www CNAME Record aliased to that A (@) Record.
I set the SSL on Cloudflare to “Flexible” (and did not install SSL on my digital ocean droplet.)
I used the Wordpress One-Click installer to spin up a Wordpress site using the directions here:
Following the completion of the Wordpress install, I was getting ERRTOOMANY_REDIRECTS (but only when trying to log in at /wp-admin. The front of the site showed no errors).
In order to correct this error, I needed to change the WordPress Address (URL) and the Site Address (URL) at Settings - > General in the /wp-admin (backend) of the Wordpress site. However I couldn’t login to the admin of the Wordpress site in order to do this, due to the ERRTOOMANY_REDIRECTS error.
I’m an FTP user, so I used FileZilla to add the settings below to the file wp-config.php which corrected the problem and allowed me to log in at /wp-admin (hooray!)
In FileZilla, I right-clicked on remote file, then clicked View/Edit (I did it this way, because I found that if I downloaded, edited, and then re-uploaded the file it changed the “owner” of the file which cause other problems.)
This opened the file in my text editor (I use Edit Pad Pro.)
Then I added the following to the end of the wp-config.php:
Using http not https
Making sure to use the www
I clicked Save in my local file editor, then went back over to FileZilla which then showed a prompt to Upload the file back to the server.
I clicked Yes, and checked to make sure the “Owner” of the file hadn’t changed.
This worked for me.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.