Configuring a WordPress Network (without login loop)

Using a WordPress network seems to be interesting as soon as you run multiple WordPress instances on different domain names. You can safe a lot of work using a network installation because you have to maintain just one software installation.

That’s what we did here. There is a great page with configuration instructions found here. We chose the domain based installation and basically everything worked as expected. But unfortunately not everything (the site runs with an Apache web server on FreeBSD).

As soon as we added users to sites those users were unable to login. There seems to be some kind of redirect loop similar to what is described here. There are several other pages found on the web which describe a similar behavior. Unfortunately, the solution was not found directly and it took several hours of debugging and searching Google. A French guy brought a solution (sorry dude, can’t remember your URL).

Simply edit the following ‘define’ in your wp-config.php like this:

define( 'DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);

Another question that may come up is what to do if you want to add some subfolders to your domain (on your web server) which are not under control of WordPress (such as e.g. downloads or whatever). In the WP network installation with Apache’s mod_rewrite everything will be redirected to WP. You can circumvent this by either modifying your rewrite rules in such a way that those subdirectories are excluded (done with RewriteRule ^subfolder.* - [L]) or more simply by just adding the Apache directive Alias to your server configuration.

1 comment

    • Paul on February 27, 2012 at 3:58 pm

    Thanks for this great hint.
    Had same problem.

Comments have been disabled.