Support » Networking WordPress » All non-www URLs redirect to www URL

  • kcomphlint


    I have a multisite install running 3 sites. It seems that anytime you to or, it automatically redirects to

    I am not sure if this is a DNS issue or just the way the MultiSite was configured or what. I have verified that the htaccess file is still just the basic htaccess.

    Also, the “domain” under Network Admin > Site is set to have the www in it.

    Also, this is in the wp-config file:

    define( 'DOMAIN_CURRENT_SITE', '' );

    Here is an example: (will redirect back to

    Any ideas?

Viewing 6 replies - 1 through 6 (of 6 total)
  • abesanchez


    I am having the same problem, when I put in it redirects me to I can go to after the main site loads, but it always redirects on the first attempt. Sucks if they are running an ad or something for that URL. I’ve looked and haven’t found anything yet. 🙁

    Moderator Ipstenu (Mika Epstein)


    I have verified that the htaccess file is still just the basic htaccess.

    The basic MULTISITE htaccess ?



    This is what I have, what WP told me to place in the htaccess, the one from Network Admin–>Settings–>Network Setup. I just noticed also that this happens when trying for wp-amin, basically anything on the first attempt.

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress
    Moderator Ipstenu (Mika Epstein)


    abesanchez – Make your own post please so we can help the OP 🙂 It’s really hard to help multiple people with server problems in one thread, since you lose track of what’s going on where.



    Ipstenu – yes, the standard multisite htaccess.

    I think the issue is that if you put the in as the site/network URL, you ALWAYS have to use the www, but if you just put in, then you can use either.

    Is that correct?

    Moderator Ipstenu (Mika Epstein)


    That is correct on most servers (some are smarter than others, I’ve not yet sorted out why).

    Try putting this in your .htaccess, above the WordPress lines:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^(.*)$$1 [R=301]
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘All non-www URLs redirect to www URL’ is closed to new replies.