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

    (@ipstenu)

    ?????? Advisor and Activist

    Try putting this in your wp-config:

    define( 'NOBLOGREDIRECT', 'https://www.mysite.com' );

    The other option is to edit your .htaccess to force the redirect. But this is why we tell you not to use www in your Multisite networks. Some servers are stupid.

    Thread Starter Dexters Lab

    (@cohrac)

    Hello,
    Thanks for the reply.

    I put that the wp-config. I’m now getting an error 310, too many redirects. It’s happening when I try to log in to the Network Admin.

    I read something saying to do a search and replace on the database to take out the ‘www.’

    That didn’t work either.

    To edit the .htaccess, what would I need to add?

    Thanks again.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I read something saying to do a search and replace on the database to take out the ‘www.’

    That didn’t work either.

    That one entirely depends on how you did it.

    Serious question: How new is this site? It’s honestly easier to delete the subsites, revert to single instance WP, move the URLs to non-www, and start over.

    If you can’t, then it’s one of these:

    #FORCE www
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.tld [NC]
    RewriteRule ^(.*)$ https://www.domain.tld/$1 [L,R=301]

    or

    # canonical redirect to no www
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

    It depends on your server.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Subdirectory is being redirected.’ is closed to new replies.