WordPress.org

Support

Support » Multisite » [Resolved] Force www on multisite.

[Resolved] Force www on multisite.

  • I used the following snippet to force www on my domain, and it did seem to work. But all other sites are redirecting back to my main site. E.g blog.mydomain.com goes through http://www.mydomain.com/index.php to http://www.mydomain.com. Now I don’t want that. So is there another way to hack the .htaccess file?

    RewriteCond %{HTTP_HOST} !^www.mydomain.com$
    RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301]

    Any help will be greatly appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Just install it when your site is using the www. No need to force anything.

    So sorry, but I don’t understand what you are saying. I have already installed everything and it is all live. How can I go from there to have www on my domain?

    Thank you for the prompt reply =)

    I need to know this too.

    Anyone?

    What she said was ‘If you set up your site, from day one, to be http://www.domain.com, then it’ll be fine.’

    Also that .htaccess hack works, but … I think you want this.

    RewriteCond %{HTTP_HOST} !^mydomain.com$
    RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301]

    Thanks for the reply! Yes, I was afraid that is what she meant.

    After many, many failed attempts I figured the code should be placed in the root .htaccess (duh!) since this domain I am talking about is an add-on. Turns out your code works wonders. Everything should be in order now.

    Thank you! I really appreciate your help. 😀

    Oh yeah, above the WordPress lines in your root .htaccess is best 🙂

    The only time you’d want to add those to the subdomain .htaccess would be if you want to redirect THAT back around to the MAIN domain (which … I did recently when I flipped from subdomains to subfolders for another site).

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Force www on multisite.’ is closed to new replies.