Support » Localhost Installs » WordPress Multisite Redirect Loop on Localhost

  • So many people seem to have trouble with this, but I haven’t found anything that fixes my issues.

    WPMU 4.o (recently upgraded) moving to XAMPP 3.2.1 for development.

    My site is at localhost/mysite, or on my machine at C:\xampp\htdocs\mysite.

    When I try to visit my site at localhost/mysite I get “This webpage has a redirect loop” or “The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete”.

    content of .htaccess

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

    content of wp-config.php

    <?php
    # Database Configuration
    define( 'DB_NAME', 'mysite2014-11-14' );
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', 'utf8_unicode_ci');
    $table_prefix = 'wp_';
    
    # Security Salts, Keys, Etc
    define('AUTH_KEY',         'xxxxx');
    define('SECURE_AUTH_KEY',  'xxxxx');
    define('LOGGED_IN_KEY',    'xxxxx');
    define('NONCE_KEY',        'xxxxx');
    define('AUTH_SALT',        'xxxxx');
    define('SECURE_AUTH_SALT', 'xxxxx');
    define('LOGGED_IN_SALT',   'xxxxx');
    define('NONCE_SALT',       'xxxxx');
    
    define('WPLANG','');
    
    define( 'WP_ALLOW_MULTISITE', true );
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'localhost/mysite' );
    define( 'PATH_CURRENT_SITE','/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    
    # Thats It. Pencils down
    if ( !defined('ABSPATH') )
      define('ABSPATH', dirname(__FILE__) . '/mysite');
    require_once(ABSPATH . 'wp-settings.php');

    I have some other WP and Drupal sites working locally. Mod rewrite is enabled.

    When I comment out the multisite stuff in the wp-config.php file, the site partially loads, but with an error message about get_blog_details (which is expected). So it’s something about the multisite.

    I’ve been troubleshooting this for two weeks, and I can’t figure out what to do. Any help would be appreciated!

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • We use Vagrant for localhost now. XAMPP/WAMP/MAMP are VAMPS lol, they are not exactly like the real world. Get used with vagrant instead of the old methods. There are WPengine like vagrant available. Read about Vagrant – http://wordpress.tv/2013/10/19/jeremy-felt-hi-wordpress-meet-vagrant/

    Your htaccess looks fine with exception to your file uploads script. You may wish to comment that out while you debug.

    When I comment out the multisite stuff in the wp-config.php file, the site partially loads, but with an error message about get_blog_details (which is expected). So it’s something about the multisite.

    Usually when that happens, try commenting out all the Multisite lines in wp-config.php except for:

    define( 'WP_ALLOW_MULTISITE', true );

    Also, comment or disable your htaccess file for now. Then if you’re able to get into /wp-admin/ and view Network Setup, try to copy-paste those fresh snippets again.

    Start there.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress Multisite Redirect Loop on Localhost’ is closed to new replies.