WordPress Multisite and WWW Redirect

One of the questions that we’ve been asked repeatedly in the last week, is how do I redirect my WordPress Multisite (WPMU) parent site to WWW? Here’s the problem – if you install WPMU, visitors that type your domain name but skip the ‘www’ part of the address won’t be taken to your website. Instead they’ll be asked if they want to sign up for a ‘New Website’. Not their intention at all! The good news, a fix is very easy. Using FTP, log into your website, and then find and backup a copy of your .htaccess file located in the public www folder. Now and add the following, and replace ‘domain’ with your domain name and ‘.com’ with your domain suffix.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule (.*) http://www.domain.com/$1 [L,R=301]

The next step depends on your hosting – you may need to remove the ‘www.’ from your DNS setup. That’s it! Now visitors that skip the ‘www’ part of your domain name will be automatically forwarded to your parents website. Do you have a comment to add?

Share

Leave a Reply

Your email address will not be published. Required fields are marked *