WordPress.org

Ready to get started?Download WordPress

Forums

All non-www URLs redirect to www URL (7 posts)

  1. kcomphlint
    Member
    Posted 2 years ago #

    I have a multisite install running 3 sites. It seems that anytime you to domain.com/site1/ or domain.com/site1/page1, it automatically redirects to http://www.domain.com

    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', 'www.thesummitonline.com' );

    Here is an example: http://thesummitonline.com/birmingham (will redirect back to http://www.thesummitonline.com)

    Any ideas?

  2. abesanchez
    Member
    Posted 2 years ago #

    I am having the same problem, when I put in bathplanet.com/reno it redirects me to bathplanet.com. I can go to bathplanet.com/reno 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. :(

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

    The basic MULTISITE htaccess ?

  4. abesanchez
    Member
    Posted 2 years ago #

    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
  5. 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.

  6. kcomphlint
    Member
    Posted 2 years ago #

    Ipstenu - yes, the standard multisite htaccess.

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

    Is that correct?

  7. 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} !^www.your_domain.com$
    RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

Topic Closed

This topic has been closed to new replies.

About this Topic