CloudFlare + WP unstable with too many redirects issue

wordpress

#1

Hey guys, I’m running several sites with HTTPS + Wordpress + CloudFlare activated, which is resulting in too many redirections:

http://example.com -> http://www.example.com -> https://www.example.com -> https://example.com

I understand that this config is not ideal for speed but was unable to find out the right config combination to make it work

The only working combination I’ve found is:

-Add WWW: Make http://example.com/ redirect to http://www.example.com/ (Mandatory for CloudFlare to work)
-Wordpress url: https://example.com

I think the ideal scenario would be:

-Exact URL set to https://www.example.com/ instead of https://example.com/

-Add WWW: Make https://example.com/ redirect to https://www.example.com/ (Mandatory for CloudFlare to work)

-Wordpress url set to https://www.example.com

This way it should work like this:

http://example.com -> https://www.example.com

This way wouldl eliminate that many redirects, but wordpress doesn’t seem to work as well (or sometimes at all) with the www. in the url.

Can anyone help me figure out what’s the best config for running a website in this case??

Thanks a lot for your help!!

Regards.


#2

I don’t see why wordpress should not work well with or without the www in the url. What’s the exact symptom you see?


#3

Well, I think the same about that, shouldn’t be a problem. I’m getting mixed results depending on the site I test it on. From random too much redirects, to site unreachable or completely broken site, etc.

I’m almost certain it was an .htaccess + cache problem, but I think I’ve got it, restarted the whole process and now testing on a site without any hiccups so far!

I’ll let you know if I find something out of place again. Thanks!


#4

Hello,

I have the exact same problems too. So every time I have to disconnect from cloud flare in order to solve this issue.


#5

I’m afraid but it’s almost impossible to figure things out without more details :frowning:

Some things you can do on your own to debug this: check httpd logs on your wordpress server, check what urls are being called and where things are redirected; check the base url of wordpress wp-admin/options-general.php if it contains or not the ‘www’…

what’s the domain? maybe we can figure things out from there. If you don’t know how to do the things I suggest, ask and I’ll give you more details.