Support » Networking WordPress » URL Redirects Without www. Go to Main Network Homepage

  • Not sure what’s going on but I installed my multisite with the “www”, along with the directory site option. So my urls look like:

    http://www.networksite.com/site1/
    http://www.networksite.com/site2/
    http://www.networksite.com/site3/

    The problem is, when visiting any of the sites without the “www”, for example – http://networksite.com/site1/, it will just redirect to http://www.networksite.com/

    It’s a fresh install and my .htaccess file looks like this:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress

    anyone know what’s going on with this?

    thanks!

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

    (@ipstenu)

    Lead Plugin Wrangler

    Do you have no_blog_redirect set in your wp-config.php?

    No, nothing like that there.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Well. The most likely culprit is that one. Darn. Second is that your server is configured that way :/

    I would put this in the top of my .htaccess:

    RewriteEngine on
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^!www\.domain\.tld$ [NC]
    RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301,L]

    That will force it before it hits WP.

    I know this is going to sound weird but, am I supposed to leave it as “domain” or replace that with the site’s domain? If I replace it, it doesn’t work… which I thought was kind of weird.

    Plus, the above code works on FireFox but not on Chrome? Chrome still redirects it back to the primary network domain.

    thanks

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Replace domain and tld with whatever yours are. So mine would be

    RewriteEngine on
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^!www\.halfelf\.org$ [NC]
    RewriteRule ^(.*)$ http://www.halfelf.org/$1 [R=301,L]

    Thanks… I did that but it still redirects back to the primary domain.

    However, the htt://primary.com, redirects to add the www.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    However, the htt://primary.com, redirects to add the www.

    Okay.. so what’s not working?

    You mean that http://primary.com redirects to http://www.primary.com then everything under that (http://primary.com/foobar) should also redirect.

    Can you possibly share your real URLs?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘URL Redirects Without www. Go to Main Network Homepage’ is closed to new replies.