Multi-domain WordPressMU Made Easy

Posted on by Alex in Randomness, Software

So I was fighting with WordPress MU for about 6 hours today attempting to get it to properly serve blogs for multiple domains and paths. This seemed like it wasn’t going to work since WPMU is configured to use either subdomains or subdirectories and all multi-domain solutions seem to only work when using subdomains.

Somehow, through the magic of mod_rewrite I was able to get multiple domains working while using the ‘subdirectory’ configuration in WPMU. The only problem I ran into was that I was unable to login to wp-admin in the non-default domains. I realized this is because of the ‘domain’ defined in the cookie. To remedy that, I changed a single line in my wp-config.php to the following:

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

That tells WPMU that the current domain is the one PHP sees. Surprisingly this fixed the cookie issue, and hasn’t triggered any other errors. We’ll see how it holds up.

Leave a Reply

You must be logged in to post a comment.