LimitInternalRecursion - Request exceeded the limit of 10 internal redirects due to probable config

I am running into problems with users being banned. After a recent increase in hacking attempts, I asked my hosting company to create stricter rules. Unfortunately, many of my users are now being banned.

Apparently, the problem is related to incorrectly configured redirects that keep connections open. Therefore, a user may only visit a few pages on different sites in my network, but have 50 - 100 open connections. 1. Does this make sense?

I have Pretty Link installed and use it to redirect traffic through my network for affiliate tracking. Referrals bounce from a satellite site into the main site and back out. As a result, referrals incur two redirects. This plugin has an option for WordPress Redirection Action with the following note "Defaults to use WordPress' 'init' action. Init works more reliably for many users but the better option for performance and compatibility is to use the 'template_redirect' action."

2. I am not sure how these two options affect this problem. Which setting do you recommend?

3. I had Hit Tracking enabled. I am not sure how this might affect the problem.

4. I also have a Login Redirect created through functions.php (code below), and BPLogoutRedirect plugin. I'm not sure how these might affect this problem.

function bp_homepage_to_profile() {

	global $bp;
	if(is_user_logged_in() && bp_is_front_page()) {
	wp_redirect( $wpmu->loggedin_user->domain . '/account' );
	}
}

add_action('wp','bp_homepage_to_profile');

My hosting company's comments are as follows:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://bookclubreading.com/add-a-book/

So, every time you're redirected to a new page, it opened a new connection without closing the first one, eventually blocking you.

50 connections is pretty strict so I increased it to 100, but this redirect issue should definitely be looked into by your developer.

The issue here is not with the limit, but most probably with incorrectly set up redirections. Also, you're not getting blocked because of it, but because of the number of connections it generates at that moment.

I'm not sure where to begin, esp since I just had a user banned for logging in, then closing her browser and opening the site again in a new browser. She didn't do anything with redirects. So, I'm a bit confused.

  • Michael Bissett

    Hey @Chris, Michael here! :slight_smile:

    In regards to this:

    I have Pretty Link installed and use it to redirect traffic through my network for affiliate tracking. Referrals bounce from a satellite site into the main site and back out. As a result, referrals incur two redirects. This plugin has an option for WordPress Redirection Action with the following note "Defaults to use WordPress' 'init' action. Init works more reliably for many users but the better option for performance and compatibility is to use the 'template_redirect' action."

    I had mentioned on the live chat today that you'd want to try using the "template_redirect" action, not sure if you've tried that yet or not?

    3. I had Hit Tracking enabled. I am not sure how this might affect the problem.

    Is this inside of Pretty Link? And would this be the free version, or the pro version?

    4. I also have a Login Redirect created through functions.php (code below), and BPLogoutRedirect plugin. I'm not sure how these might affect this problem.

    If that were disabled temporarily, how much of a drop in redirects does that show?

    Also, what's the .htaccess for your site look like presently?

    Please advise,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.