Multisite Redirect Loop - Network Type Change

Morning :slight_smile:

I have a multisite that is currently stuck in a redirect loop for the front end. The admin panel works fine.

The site was initially setup as a WordPress 3.5 standalone in its own directory. I then followed the instructions for "Create A Network" on the WP Codex site, which allowed me to setup the site as a multisite. As the blog was over a month old at the time (with very few posts) the network setup would only allow a subdomain network to be created.

After the setup had completed I installed the WordPress MU Domain Mapping plugin in preparation for the new sites I was going to create. I then followed the instructions for "Switching Network Types" as I knew I wouldn't have any issues with existing posts and new site names.

My site is now stuck in a redirection loop.

When I visit the site (www.lfct.org.uk) using Chrome I get a 310 error (too many redirects) and the URL changes to "www.lfct.org.uk/lfctwp/lfctwp/lfctwp/lfctwp/lfctwp......."

I have tried reverting the wp-config and .htaccess changes back from subfolder to subdomain but it still doesn't work.

Does anyone have any suggestions?

Many thanks,
James

  • landauforte
    • Site Builder, Child of Zeus

    Here is what I have in my .htaccess file (located in the website root) at the moment:

    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]

    Here is what I have in my wp-config.php file (located in the website root) at the moment: (passwords, etc, removed)

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information
     * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    define('FTP_USER', 'XXXXXXX');
    define('FTP_PASS', 'XXXXXXXXXX');
    define('FTP_HOST', 'XXXXXXXX');
    
    /**
     * Settings for Bit.ly Shortlinks Plugin
     * http://yoast.com/wordpress/bitly-shortlinks/
     **/
    define('BITLY_USERNAME', 'XXXXXXXXXXXXXX');
    define('BITLY_APIKEY', 'XXXXXXXXXXXXXXX');
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'XXXXXXXXXXX');
    
    /** MySQL database username */
    define('DB_USER', 'XXXXXXXXXXX');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'XXXXXXXXXXXXXXXX');
    
    /** 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',         'XXXXXXXXXXXXXXXX');
    define('SECURE_AUTH_KEY',  'XXXXXXXXXXXX');
    define('LOGGED_IN_KEY',    'XXXXXXXXXXXXXX');
    define('NONCE_KEY',        'XXXXXXXXXXXXXXXXXXX');
    define('AUTH_SALT',        'XXXXXXXXXXXXXXXXXXX');
    define('SECURE_AUTH_SALT', 'XXXXXXXXXXXXXX');
    define('NONCE_SALT',       'XXXXXXXXXXXXXXX');
    
    /**#@-*/
    
    /**
     * 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  = 'XXXXXXXX';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress. A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
     * language support.
     */
    define('WPLANG', '');
    
    /**
     * 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.
     */
    define('WP_DEBUG', false);
    
    /* Multisite Settings */
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'www.lfct.org.uk');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define('WP_DEFAULT_THEME', 'lfuniversal');
    
    /* WordPress MU Domain Mapping */
    define('SUNRISE', 'on');
    
    /* 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');
  • landauforte
    • Site Builder, Child of Zeus

    Hi Ari

    That seems to have fixed the issue! Thank you. I don't know why I didn't think about removing that in the first place #doh

    I have noticed another issue, however. If I hover over the 'My Sites' link and click on 'Network Admin' it seems to strip out the subfolder name and take me directly to:

    http://www.lfct.org.uk/wp-admin/network

    instead of:

    http://www.lfct.org.uk/lfctwp/wp-admin/network

    If I add the subfolder in the page works fine. Could this be causing some issues too perhaps? I don't suppose you know what might be causing this or how I can fix it do you?

    All other menu links and the link to the main site under the 'My Sites' menu work fine.

    Many thanks,
    James

  • landauforte
    • Site Builder, Child of Zeus

    Haha no worries. Yeah, I'm glad it's sorted too. Perhaps a bug with the domain mapping plugin. I followed WordPress' switching network types steps to the letter. Hmmm.

    Oh well, I'll give it another go now I have a subfolder network setup.

    Thanks again for all your advice :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.