WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] ERR_TOO_MANY_REDIRECTS (nur) unter /wp-admin/network/ (6 posts)

  1. Tobias Jordans
    Member
    Posted 2 years ago #

    Hi!

    We have a WordPress Multisite running at betterplace.org and get this error, when we open http://www.betterplace.org/c/wp-admin/network/ :
    Fehler 310 (net::ERR_TOO_MANY_REDIRECTS): Zu viele Umleitungen.

    The Setup:
    – betterplace.org is running rails application servers
    – There is a rewrite-rule on server-level that maps everything that goes to /c/ to be pulled from/redirected to the PHP-Server in the Cluster
    – WordPress MU installed on this php-server in the sub-folder /c/
    – phpinfo() tells us
    –– Hostname:Port static.betterplace.org:0
    –– HTTP_HOST static.betterplace.org
    This is the URL that the server use internally to talk to each others so we cannot change this.

    That part is working:
    http://www.betterplace.org/c/help runs like it is supposed to
    http://www.betterplace.org/c/help/wp-admin as well
    http://www.betterplace.org/c/wp-admin/ as well

    BUT that part is not working:
    – All links that go to /wp-admin/network/ result in the given error-message
    – When I open http://www.betterplace.org/c/hilfe/wp-admin/edit.php the paginations shows link that go like this http://static.betterplace.org/c/hilf...it.php?paged=2 – So for some reasons wordpress (core) uses another URL here

    Our wp-config.php (In parts):

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/c/';
    define('DOMAIN_CURRENT_SITE', 'www.betterplace.org');
    define('PATH_CURRENT_SITE', '/c/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Our .htaccess:

    RewriteEngine On
    RewriteBase /c/
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    What we made sure of:
    We checked the complete database if there are some "wrong" URLs somewhere.
    It is all clean … except for the *_blogs table.
    Inside the *_blogs there are three blogs wich have a domain name with ""static.betterplace.org"
    So that is the URL that the servers use to recognize eachothers (see introduction).
    Once I change this in www.*, the site goes down! (It redirects to http://www.betterplace.org).

    So there are 2 questions:
    – Why can we access all pages in our backend except for the everything in the "network"-"folder"?
    – Why is there a wrong URL in the pagination?

    Thanks for your help
    Tobias

  2. Tobias Jordans
    Member
    Posted 2 years ago #

    Sorry, forgot to translate the title. "ERR_TOO_MANY_REDIRECTS (nur) unter /wp-admin/network/" actually means "ERR_TOO_MANY_REDIRECTS at /wp-admin/network/ (only)". Unfortunately there is no edit-button so here it goes… :)

  3. Edit button vanishes after an hour. (And thankfully error messages are standard, so we knew what you meant).

    I'm actually a little stumped here, because the best answer I have is a bad one. WordPress doesn't mind if you move the images (wp-content/uploads and wp-content/blogs.dir) to other servers. But it gets a little narky when your core code is in a different place. It's just not happy about it.

    Would it be possible to change the three sites from static.betterplace.org to betterplace.org and then use .htaccess to redirect things? I don't even know if that would work :/

  4. Tobias Jordans
    Member
    Posted 2 years ago #

    With the help of http://inpsyde.com/ we solved the problem.

    First lets complete the error report by adding the apache rewrite-rules that we use to handle the communication between the rails- and php-server (see above where I talk about "server-level" …).

    [lorem@ipsum virtualhosts]# cat betterplace.static_balancer.conf
      RewriteEngine On
      RewriteRule ^/c/(.*)$ balancer://betterplace/c/$1 [P,QSA,L]
      <Proxy balancer://betterplace>
        BalancerMember http://static.betterplace.org retry=2
      </Proxy>

    This is what is wrong:
    WordPress uses the variable $_SERVER[ 'HTTP_HOST' ] all over the place in the core. That is not really smart from my point of view, since it creates special variables like DOMAIN_CURRENT_SITE for multisites … but that is another story.
    In our case, since we have this special apache rewriting, our HTTP_HOST always was "static.betterplace.org" – and not "www.betterplace.org" which is the URL that we need.
    This setting caused all problems that I described below:
    – The redirecting error
    – The broken pagination on wp-admin/edit.php
    – The wrong domain in the wp_blogs table

    This is the solution and how to fix it:
    In our wp-config.php, we overwrite the given server-variables that cause the problem by adding this below your database-configuration in wp-config:

    if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    	$list = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
    	$_SERVER['REMOTE_ADDR'] = $list[0];
    }
    $_SERVER[ 'SERVER_ADDR' ] = DOMAIN_CURRENT_SITE;
    $_SERVER[ 'REMOTE_ADDR' ] = DOMAIN_CURRENT_SITE;
    $_SERVER[ 'HTTP_HOST' ]   = DOMAIN_CURRENT_SITE;

    You need to set your multisite define('DOMAIN_CURRENT_SITE', 'www.betterplace.org'); above this, of course.

    With this set, we can install, update and use our wordpress multisite exactly like intended at http://www.betterplace.org/c/help.

    Thanks for your help.
    Tobias

  5. nofearinc
    Member
    Posted 1 year ago #

    For the sake of the future web searching (this is the latest thread with any resulting response), the problem might be a corrupted database. There is no real message such as "DB is missing" or something, but the same 310 'too many redirects'. If you point it to a valid backup database, this might be fixed as well (considering the website has been working before).

  6. jamessnell
    Member
    Posted 1 year ago #

    I was having these symptoms too. I tried a lot of things such as disabling all my plugins and whatnot. It wasn't plugins, at least not in my plugin directory. In my case, my wp site was working fine in general, it just was redirecting to infinity when I tried to access /wp-admin

    Turned out it was my use of define('FORCE_SSL_ADMIN', true); in my wp-config.php. I've commented that out and I'm back in business. I guess that call is defunct or something.

Topic Closed

This topic has been closed to new replies.

About this Topic