Support » Networking WordPress » Can't see site without WWW

  • Resolved stuffwelike


    I installed Multisite, the main site does not load pages/posts without using a www. The subdomains do load pages/posts without a www. I’d like you to be able to access the main site without being forced to insert www. If users don’t insert the www. they’ll be redirected to the wp-signup page.

    I’ve tried changing the wp-config.php file with //define( ‘NOBLOGREDIRECT’, ” ); to //define( ‘NOBLOGREDIRECT’, ‘’ ); but that didn’t fix the issue.

Viewing 15 replies - 1 through 15 (of 15 total)
  • User registration is also turned off.

    Take the // out of that line 🙂 That means you’re commenting out the line and having it NOT run.

    define( 'NOBLOGREDIRECT', '' );

    Didn’t realize that it was commented out. lol

    Now that the line is active, if you try to go to the post/page without a www. you receive the message “The page isn’t redirecting properly.” With a www. the main website still runs fine. Subdomain sites run fine.

    Chrome says The webpage has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

    Do this:

    define( 'NOBLOGREDIRECT', '' );

    When I try to access a post/page without the www. it now redirects me back to the primary domain name with www.

    Well. Yeah, sadly, that’s how it works.

    Check your DNS to see if you have defined in there.

    We may need to use the .htaccess redirect instead, if you want to go to

    I tried inserted the following code into my htaccess, which is what I found that is supposed to redirect non-www links to www links, but nothing changed.

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

    Does it matter where you place that code in the htaccess?

    Yes, it has to be ABOVE the #begin WordPress lines 🙂

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.stuffwelike\.com
    RewriteRule ^(.*)$$1 [R=301,L]

    Done, still redirects non-www URLs to just instead of their www URL posts/pages

    Remove the redirect in wp-config.

    You shouldn’t need both.

    Removed the wp-config redirect.

    If I move that code to the top of the htaccess file, it redirects non-www URLs to www URLS. However my subdomain websites that were created in Multisite do not load their site, they are redirected to the front page of

    UGH. Okay. Try this.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^stuffwelike\.com
    RewriteRule ^(.*)$$1 [R=301,L]

    Very cool. That one redirects non-www URLs to www while not affecting the subdomains. Thanks bro! You’ve just fixed a bug that has been around for several months. 🙂

    Yeah, I should have had a brain in my pretty head and flipped it around before 😉

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Can't see site without WWW’ is closed to new replies.