'Page isn't redirecting properly' errors on wp-admin

ratelimiting
wordpress

#1

Hello

I’ve got two sites on different cloudflare accounts which both have similar issues, which appear to have happened despite me having changed nothing - they just suddenly broke. It looks like they are probably related to https and reatelimiting for which I use cloudflare.

The first one bntmedia.co.uk i get “Page isn’t redirecting properly” errors on wp-admin (its a wordpress site) and on wp-login page I get RATELIMITED “Too many requests - try again in 59 seconds” errors. It’s similar on the other site which is the most recent one to break, but the problems on wp-admin also appear on the actual site.

Changing the URL of the wordpress install to remove the https and revert to http seems to work. I’ve been working with my hosting company who set up a testing site which doesn’t use https or go through cloudflare - everything is identical, except the URL and that works fine, so it looks like its an issue with https side on cloudflare that might be causing the problems.

I’ve changed no settings really on cloudflare for either of these sites. I have flexible SSL enabled, Automatic SSL rewrites enabled, two page rules: http://bntmedia.co.uk/ - Always Use HTTPS and bntmedia.co.uk/wp-admin - Disable Performance, and thats more or less it - nothings really been changed for months.

Any ideas if the issue due to cloudflare setup, and how I can get this fixed. I have cloudflare’s plugin installed on both, but with these errors I can’t login to wordpress at all.


How does Rate Limiting work?
#2

Seems you are suffering a https redirect loop which is related to using technology, here Wordpress.
please check this out.


#3

First thing, make sure that at WordPress General settings, you have HTTPS version URL, not HTTP.

You can verify once by checking MySQL database table. If there is HTTP, you may change to HTTPS.

Or if you need very fast solution, simply define HTTPS version URL via wp-config.php

define('FORCE_SSL_ADMIN', true);
// in some setups HTTP_X_FORWARDED_PROTO might contain 
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on'; 

define('WP_HOME','https://example.com');
 define('WP_SITEURL','https://example.com');
 /* That's all, stop editing! Happy blogging. */

Then try to access, it should work. If it works, better, at last you can use Search/Replace to fix.

Also, one more thing. Make sure you don’t have vice-versa redirection in the .htaccess

#####Ref

  1. https://codex.wordpress.org/Changing_The_Site_URL
  2. https://codex.wordpress.org/Administration_Over_SSL

Why website adress doesn't have the green lock?
#4

This plugin may also help.


#5

Thanks Zaq, Gulshan and Andy for your replies. All have been really helpful. Looks like I might use your code Gulshan (just need to consult the guy at my hosting company whos supporting me with this before I implement) and Andy I have already installed that plugin on another site which doesn’t have these problems following your suggestion.


#6

You’re welcome!


#7

GulshanKumar - you saved my bacon! I altered Wordpress site including W3 Total Cache; the entire site would not load, "Page isn’t redirecting properly”. Added the code, and back on - thanks.