Support » Networking WordPress » www issue with main site in multisite

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    What .htaccess fix did you use?

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

    This works on both main site and sub sites, but breaks additional domains mapped with domain mapping. They all lead to the main site homepage.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Well right 🙂

    Your rule says “If a page is NOT domain.com, make it go to domain.com”

    Try this:

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

    It says “If a page is http://www.domain.com, make it go to domain.com”

    A subtle, but VERY important difference 😉 (The real problem is the server thinks www and non-www are different things, and you can configure vhosts to send one to the other, but .htaccess works fine)

    Thanks! Domain mapping also works.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘www issue with main site in multisite’ is closed to new replies.