I'm having some trouble getting Multisite to work on my localhost using xampp. I have the main site in a subfolder so the path would be http://localhost/my_site/.

I'm getting two different errors, either "Error Establishing Connections with Datatbase" or "too many redirects". Below is my current htaccess and wp-config setup. I'm not sure what I'm doing wrong:


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


# BEGIN WordPress
<IfModule mod_rewrite.c>
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]

# END WordPresss
  • Apache Modul mod_rewrite is active? Check the php info for this.
    – bueltge
    May 18, 2016 at 19:39
  • Yes, it's active
    – brandozz
    May 18, 2016 at 20:05

1 Answer 1


There is actually nothing unique about setting multisite on XAMPP, all you need to do is properly configure the webserver as a proper webserver, and skip the lazy practice of using localhost as your site domain.

Select some random domain you are not likely to use in your web use, edit your hosts file to point that domain to, and set the vhost in the appache configuration. Once done you should not have any problem to setup wordpress and multisite.

  • To specifically fix my issue I needed to remove the "http://" from the url in the sites and blogs tables. But I did go ahead and follow your advice. I'm not using domains but I did edit my hosts file and setup some vhosts in appache to remove the "localhost" from the url. Thanks for the tip!!
    – brandozz
    May 20, 2016 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.