• I have a website running multisite using a subdirectory setup. I have just tried updating my site to 4.7.2 and the update goes through and no errors happen during the installation, but then after the install is finished I am redirected to /wp-admin/network/about.php?updated which returns a 404 page. So then I try to go back to /wp-admin/ and I get a redirect loop error.

    I have looked through at least 40 different articles, forums, and websites about WordPress multisite wp-admin redirect loop issues. I have tried everything I can possibly find to fix this issue, but nothing has worked. The main site works perfectly fine, but wp-admin is completely unaccessible.

    Here are the things I have tried so far:

    1. I tried clearing my cache and cookies multiple times, and the site is not using any caching plugins
    2. I renamed my plugins folder to plugins.deactivate
    3. Just to be extra thorough I also updated active_plugins field in the wp_options table to a:0:{}
    4. I tried removing multisite definitions from my wp-config.php file, but when that had no effect I put them back
    5. I confirmed my .htaccess file matches the one listed here for 3.5+ multisite – https://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite
    6. I also tried switching it to the old version, just in case, but that did nothing so I switched it back.
    7. I found a forum saying that they fixed the issue by commenting out a redirect at the bottom of /wp-admin/network/admin.php so I tried that but it did nothing so I uncommented it back to normal.

    Here is my .htaccess file:

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

    And here is my wp-config.php file:

    <?php
    /**
     * The base configuration for WordPress
     *
     * The wp-config.php creation script uses this file during the
     * installation. You don't have to use the web site, you can
     * copy this file to "wp-config.php" and fill in the values.
     *
     * This file contains the following configurations:
     *
     * * MySQL settings
     * * Secret keys
     * * Database table prefix
     * * ABSPATH
     *
     * @link https://codex.wordpress.org/Editing_wp-config.php
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME, 'DBNAME');
    
    /** MySQL database username */
    define('DB_USER', 'DBUSERNAME');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'DBPASSWORD');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY',         '6YuB7pAuURnDjyFUcb3Q3rVrWiNk6K872AyD1pP2t09WPxY09Z3BVxaSFWmQxYcM');
    define('SECURE_AUTH_KEY',  'FIoVpmtRhYJNWrE2G689bp2GinApBgY47OVVxrZiS4Y134lqLYIbvf57PIqSoQTX');
    define('LOGGED_IN_KEY',    '8zC1jLLeAe2DH1E4k7KwXpLlkKaZEzVkDqOjx4z6csRERQhsqYvdQsroXbqvR7MG');
    define('NONCE_KEY',        'Vcz1A0I1e37bksIaA5wFWQBHvJtt6zRwzmQDAlwUOW2Eo21Mn23tUldujrbwtv6s');
    define('AUTH_SALT',        'ng5aCZQQ1bHQ1YkO1QlZwdcLp38yXAHssnEtofvqCL67PeVQUiFNh7Ns1UkSjMai');
    define('SECURE_AUTH_SALT', 'ZP0xk8ldQc0OftLgpADR4toNPCN4sLEFuSTaRWTmGBu8dyEs1yXfwEq8Gag00AWi');
    define('LOGGED_IN_SALT',   'VKmGsDjfILr5HeEXJuL7WlQ0UUcRvZQrT5Z47cR7mied28FvREetf0pvxwSE8M7l');
    define('NONCE_SALT',       'JexGduB5BSCxcgNbTYEsfaKudzbcK9PzFaRgkMZUUlFy4GoQjUSx1i2MEcK8Byfv');
    
    /**
     * Other customizations.
     */
    define('FS_METHOD','direct');define('FS_CHMOD_DIR',0777);define('FS_CHMOD_FILE',0666);
    define('WP_TEMP_DIR',dirname(__FILE__).'/wp-content/uploads');
    
    /**
     * Turn off automatic updates since these are managed upstream.
     */
    define('AUTOMATIC_UPDATER_DISABLED', true);
    
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each
     * a unique prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'kl9t_';
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     *
     * For information on other constants that can be used for debugging,
     * visit the Codex.
     *
     * @link https://codex.wordpress.org/Debugging_in_WordPress
     */
    define('WP_DEBUG', false);
    
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    Oh, I forgot one other thing I had tried. I found another forum saying you need to define cookie paths in wp-config.php. So I had tried that by adding the code below to my wp-config.php, but it didn’t work either so I removed it.

    define('ADMIN_COOKIE_PATH', '/');
    define('COOKIE_DOMAIN', '');
    define('COOKIEPATH', '');
    define('SITECOOKIEPATH', '');

    Next time dont post your entire wp-config.php; you’re going to post sensitive info accidentally one day. Basically only post between the WP_DEBUG and ‘That’s all, stop editing!’ lines.

    My guess is something wrong with your .htaccess file. First back it up. Second remove it (or rename it). You should be able to access your main site still even without .htaccess; but you wont be able to access your subsites without it. After that go back to your Network -> Settings -> Network Setup to get the .htaccess config information. Create a new .htaccess file from it. Make sure you are copying and pasting properly.

    Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    I renamed my .htaccess to .htaccess.bak and tried again but still getting redirect loop error.

    Thanks for the tip. Just wanted to give as much info as possible. I checked for sensitive info before posting though.

    What does the redirect loop – /wp-admin?

    Is this a public site or in development? I would remove all plugins by renaming the plugin directory. Maybe one of your plugins is causing a loop. Any recent plugin installed or updated? Or maybe a security plugin

    Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    Thank you for you continued suggestions jkhongusc. Please read the post in full. I have already renamed my plugins directory and zeroed out the active_plugins field in the wp_options table.

    I’m doing this on a staging site right now so I can pretty much just keep trying to break everything until I figure out what’s causing the redirect, after I tried updating the production site and had to roll back.

    I’ve tried everything I have found through scouring wp.org and SO and anywhere else my countless variations of my google search took me for the past day and a half.

    Sorry if I sound annoyed. I’m annoyed with this issue, not with your attempts to help.

    Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    Oh, and just to add one more thing I just thought to try on a whim, I went into the options table again and changed the template and stylesheet values to the twentyfifteen default wordpress theme, thinking that maybe the problem is somewhere in my theme, but that didn’t work either.

    You should also remove any custom themes and make sure your mu-plugin folder is empty or renamed.

    Did you turn on WP debugging? What is the redirect loop (this would have to be detailed)? Can you login going directly to the login page – http://domain.com/wp-login.php?

    I am throwing out different possibilities. I still think its a plugin/theme issue.

    Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    my site is setup using a standard plugins folder, not an mu-plugins folder. It’s been a while since the site launched, but I’m pretty sure that was because the site started as a standard site and then we converted it to multisite.

    The plugins folder has been renamed though, and I just went into the options table and switched the theme to the default twentyfifteen theme.

    wp-login.php suffers from a redirect loop as well. According to the network panel in my chrome inspector it is repeatedly being forced into a 302 redirect.

    Did you ever find a solution to this? I’m experiencing the same problem. I can get in to the admin by removing the querystring completely from wp-login.php, but I’d prefer an actual solution to a workaround.

    • This reply was modified 7 years, 5 months ago by joshdaws.
    Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    I have still not found any solution. This probably won’t comfort you much, but where I’m at now is I’m going to install a completely fresh version of 4.7.2 on a new staging environment and import all of my plugins, themes, and content in an attempt to see where and if it breaks in that scenario. It’s not going to be fun, or fast, but I’m hoping it will get the job done.

    I’ll post an update to this ticket with results once I’m done in case others come across this issue as well.

    I have the same problem, went through all the steps (wp-config.php and htaccess.conf) and everything described here also, and doesn’t work on my production server. Meanwhile, in my localhost I have the same website, same database, same theme and did the exact same steps and works perfectly.
    WP version: 4.7.1
    ERROR
    When I go to any of the new multisite branches and check in console i’m getting a 404 in all the scripts.
    STATUS
    a) mysite.com/original – works fine
    b) mysite.com/original/wp-admin – works fine
    c) mysite.com/original/multisite1 – gives me 404
    d) mysite.com/original/multisite1/wp-admin – ERR_TOO_MANY_REDIRECTS
    e) mysite.com/original/multisite2 – gives me 404
    f) mysite.com/original/multisite2/wp-admin – ERR_TOO_MANY_REDIRECTS

    ex.
    c)
    requesting
    mysite.com/original/multisite/wp-includes/css/admin-bar.min.css?ver=4.7.1
    instead of
    requesting mysite.com/original/wp-includes/css/admin-bar.min.css?ver=4.7.1

    Is so frustrating, since It works in my localhost, there must be something above generating this redirection when I activate multisite.

    > This probably won’t comfort you much, but where I’m at now is I’m going to install a completely fresh version of 4.7.2 on a new staging environment

    darkhousedevelopment
    This is what I do when I have issues and it only takes a few minutes. I take a fresh copy of WordPress and drop in wp-config.php (from the instance that is broken). You dont really need to change anything else; you can copy the wp-content/uploads folder over for assets. If you still have problems with a fresh WP, no themes, and no plugins… then it is definitely an issue with the database. Most likely site configuration, maybe siteurl?

    Thread Starter darkhousedevelopment

    (@darkhousedevelopment)

    I found the issue! After trying to install a completely fresh copy of WordPress to a new subdomain and immediately getting too many redirect errors I knew the issue had to be at the server level.

    I checked my error logs in cPanel and found that it was throwing errors every time I tried to access anything in wp-admin because the files were writable by group with 0664 permissions.

    I changed all files in wp-admin and wp-includes to 0644 permissions and bam! Everything works now!

    If you are having this too many redirects issue as well check your error logs. I’m not sure if this is just my server or if WP added an extra level of security in the most recent update, but I’m just glad it’s fixed now!

    Dseg

    (@dsegggggmailcom)

    Well I have the similar issue on my local(intranet) wp dev multisite site.
    One good thing is that superadmin user DOES NOT have this issue, I can always login as superadmin, but no other user can login to its site!
    Have tried all above mentioned methods, but no use!. My wp-admin/ permissions ARE 0644.

    Dseg

    (@dsegggggmailcom)

    Solved, bad plugin ….

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘WordPress 4.7.2 update on multisite causes wp-admin redirect loop’ is closed to new replies.