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”.
- It’s a subfolder setup, so it should work on a localhost.
- I changed the wp-config.php file, making sure to set the ABSPATH to my folder directory
- I changed references in the db in wp_options, wp_site, wp_blogs
- I changed the .htaccess file in the WP folder according to this post http://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite
- I followed these guides: http://premium.wpmudev.org/blog/how-to-install-wordpress-locally-for-pcwindows-with-xampp/, http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite
- It was coming from WPengine, so I had to delete the mu-plugins.php file and the WPengine plugin in the mu-plugins folder.
- I have cookies enabled in my browsers, and have cleared my browser histories.
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 WordPresscontent 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!
The topic ‘WordPress Multisite Redirect Loop on Localhost’ is closed to new replies.