I am trying to redirect all non-www to www URLs in my WordPress MultiSite install. I am using a simple .htaccess rule like this:

# Redirect non-www to www:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Normally this would work, however WordPress already seems to have a default redirection to non-www URLs. This means that when I use that RewriteRule it causes an infinite redirect loop.

How do I disable this?

PS. I tried define('NOBLOGREDIRECT', 'http://www.domain.com'); in wp-config.php with no effect.

2 Answers 2


Answer: Don't disable it, use it to do the redirection you want.

  • If you have a subdomain install, then you cannot do this at all, the www is a subdomain.

  • If you have a sub-directory install and want all the sites to be www, then edit your wp-config.php and change the DOMAIN_CURRENT_SITE to be your www domain.

  • If you are using domain mapping, then use the domain mapping plugin to change the domain to have a www in it.

In the latter two cases, the point is that you're not using .htaccess to do the redirection, you're letting WordPress do the redirection to what it expects the URL is supposed to be.


login to admin and check go to General settings

check WordPress Address (URL) and Site Address (URL) textbox. perhaps here URL stored without www so add www before yours domain name in either both WordPress Address (URL) and Site Address (URL)

hope this helps you. all the best ;)

  • This is only possible on a single site WordPress install, not on a MultiSite one. In MultiSite there are no WordPress Address (URL) and Site Address (URL) textboxes.
    – Paul T.
    Commented Sep 15, 2012 at 15:34
  • Sorry Paul T. I didn't notice that it's multisite. please visit on this link, may be it's help you: stackoverflow.com/questions/5093654/… Commented Sep 15, 2012 at 15:55
  • Here is one more link: answers.bitnami.org/questions/4587/… Commented Sep 15, 2012 at 15:58
  • I tried both links, and no effect whatsoever :(
    – Paul T.
    Commented Sep 15, 2012 at 16:23

Your Answer

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

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