How to fix Infinite Redirect Loop with WordPress Site / Exposed IP Address?

May 27, 2019 209 views
WordPress DNS Ubuntu

I'm sure that this is going to end up being a 'DUH!' situation, but i'm new to the technical side of things and, frankly, going a bit crazy with this situation. I'd love some fresh eyes on the situation to help me see what i'm sure i'm missing.

Right now i've got a WordPress site living on DigitalOcean by way of RunCloud. DNS is managed by CloudFlare and have an A Record set up pointing from domain.com -> XXX.XXX.XXX.XXX DigitalOcean IP Address. Currently, if you type in www.domain.com you get redirected to the IP address and the site is there for the world to see... except that the IP is in the address bar which is no good and looks sketchy.

So the first thing I tried was changing the WordPress/Site Address in the WordPress General Settings page from being http://XXX.XXX.XXX.XXX to http://domain.com. BAM. Infinite redirect loop. A quick SSH into the server and a bit of monkeying with the wp-config file later, and I hard coded the WordPress/Site address back to the IP address. Site comes back up. And I can remove the hard-coded address. But now we're back to where we started.

I try removing the A Record from cloudflare. No dice.
I tried turning SSL on and off and every setting in between. Nada.
I've monkeyed around with the WordPress/Site Address some more. Same redirect loop.

I'm about at my wits end trying to solve this, and I KNOW it's going to be something stupid and obvious. So can anyone put me out of my misery and help point me in the right direction?

Thank you SO much in advance for anyone who might have a lead on this...

3 Answers

You said you removed the A record, tphokas from this page suggests that you need to have an A record for for the domain that points to the host (domain name to IP address) rather than forwarding or redirecting. I'm not sure exactly what your DNS configuration looks like, could you share that? With any identifying information blocked of course.

Without screenshot of DNS settings and URL it's very hard to understand what is the problem.
Need more information: about server stack, wp-config file and so on

Hi nothanks32432, I'm from RunCloud. Here's few tips to help you.

Firstly, please take a seat and a cup of coffee and take a break...

  1. "Pause" Cloudflare service so that we only use cloudflare DNS. This will exclude any CF setting error.

  2. Make sure the domain name A record is point to the droplet IP address, as well as "www" sub domain

  3. Make sure WordPress/Site Address are the correct domain name, not IP address. (Remove the hard coded address in wp-config.php)

  4. Check .htaccess for any unexpected redirection

  5. Patient... DNS stuff sometimes take times to take effect.

  6. You can check global dns propagation using tool like https://www.whatsmydns.net/

Lastly, feel free to open a RunCloud support ticket for assistant

Have another answer? Share your knowledge.