WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently setup a WordPress multisite install using subdomains and the WordPress MU domain mapping plugin.

When I initially setup the domain mapping plugin, I set the root (http://domain.com) and http://www.domain.com to redirect to blog ID 2 (ie. www.domain.com). However, when I do this the redirect on the root prevents me from accessing the Network admin page.

Is there a way I can change the configuration to enable me to still access the Network admin page whilst redirecting the root site to www?

share|improve this question
Can you remove the redirection from the domain mapping plugin, and place redirection of non-www to www in .htaccess using normal rewrite rules? – Steve May 20 '12 at 8:55
Shouldn't this part read like: "blog ID 2 (ie. www.another-domain.com)"? – brasofilo May 22 '12 at 10:46
up vote 0 down vote accepted

I was in a similar situation recently. I ended up putting the root site on a random subdomain (eg ms.domain.com) With the intention of never using the root site.

With that done, I created a plugin to activate only on the main (root) site.

The plugin hooks into a action that fires only on the front end (template_redirect). From there, call wp_redirect to send your visitors to where they need to be.

add_action('template_redirect', 'wpse52298_redirect');
 * Redirects all requests to the front end to another site
 * @uses wp_redirect
function wpse52298_redirect()
    // change this
    $to = 'http://www.example.com';



  • Loads basically all of WP before redirecting
  • Not as fast as redirecting in htaccess


  • Easy to maintain
  • No htaccess foo required

As a plugin.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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