Redirect loop (only for multisite network admin)

I can log into http://localhost/wp/wp-admin/ fine, but logging into http://localhost/wp/wp-admin/network/ produces a network redirect loop (ERR_TOO_MANY_REDIRECTS). The site also loads just fine even when logged in.

How can I find out what is causing this? WordPress 4.1 installed into subdirectory ‘wp’, then converted to multisite. There is only one site in the network so far.

update: This seems very relevant: https://wordpress.org/support/topic/network-site-redirect-loop-solution

  • A work-around is to remove the check to see if $current_blog->path matches $current_site->path.

I have tried clearing cookies and adding this code to wp-config:

define('ADMIN_COOKIE_PATH', "https://wordpress.stackexchange.com/");
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');

My .htaccess (unmodified from WordPress multisite setup):

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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).*) wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
RewriteRule . index.php [L]

6 Answers
6

I also had the same redirect problem when trying to access wp-admin/network. Performing below changes fixed it.

1). In wp-config.php file, added www.website.com rather than just website.com
define('DOMAIN_CURRENT_SITE', 'www.website.com');

2). use phpmyadmin –> wp_blogs table
Add www. to the domain value

Basically, both site name and blog name have to be exactly the same.

Cheers!

Leave a Comment