• I need to set up a development site for a live Multisite, and I’m trying to move everything to a localhost powered by XAMPP. This is my first time moving an exisitng multisite to local, so I’m probably doing something wrong.

    My XAMPP install works fine on other WP and Drupal sites, and works for this site when not in multisite mode.

    I’ve moved over the database and files to local. I ran interconnectit on the database, and changed my wp-config.php to point to the new database.

    When I comment out all the multisite configurations in wp-config.php I can view and log onto the site just fine (but it’s not a wp multisite of course).

    When I add in the multisite configurations I get either a redirect loop or a database connection error depending on how I set them up.

    The following is how I had it setup on the live server, with ‘localhost’ replacing the URL. This gives me a database connection error.

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    define( 'PATH_CURRENT_SITE','/' );
    define( 'DOMAIN_CURRENT_SITE', 'localhost');
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    The following is what Tools -> Network Setup tells me to paste in my wp-config file. It tries to go to “http://localhost/nn/nn/”. It gives me a redirect loop.

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'localhost/nn');
    define('PATH_CURRENT_SITE', '/nn/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    The following seemed a logical change. It tries to go to http://localhost/nn/, which is correct. However, it still has a redirect loop.

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'localhost/nn');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    I also have in my wp-config.php the following:

    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
      /*define('ABSPATH', dirname(__FILE__) . '/');*/
      define('ABSPATH', dirname(__FILE__) . '/nn/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    It doesn’t seem to matter what I set the ABSPATH to, I still get a redirect loop.

    Here is my htaccess file:

    RewriteEngine On
    RewriteBase /nn/
    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]

    I disabled all plugins by renaming the plugins folder. I get the same issues.

    The theme for blog 1 is an unmodified studiopress theme, so it’s pretty safe.

    I get this issue even when I clear cookies, so I don’t think it’s this issue: https://tommcfarlin.com/resolving-the-wordpress-multisite-redirect-loop/.

    The paths and domains look correct to me in the wp_blogs table, and in the individual wp_#_options tables. (They should be, I ran interconnectit on the whole database.)

    I’ve been looking for a fix, but haven’t found anything where the site worked as a single install but didn’t as a multisite.

    Any advice would be appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Moving WP Multisite to localhost, redirect loop’ is closed to new replies.