Change default non-www primary domain to www version on Multisite 3.3.1 (8 posts)

  1. issora
    Posted 4 years ago #

    Hi there!

    Forgive me if this has been answered, as I know variations of this topic have been discussed at length, but I can't seem to find my specific answer...

    I have Multisite installed at a GoDaddy hosting account, setup as subfolders, and am successfully using this domain mapping plugin -http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/.

    The domain mapping plugin allows me to map both the www and non-www versions of the child site domains, while setting the www version as primary.

    However, the main domain has the non-www version set as primary and I can't figure out where or what is setting this to be so. This main domain is http://www.defamationofcharacter.net.

    Also, to rule out any crazy .htaccess settings as the issue, I've included mine below. As far as I can tell, it's pretty basic:

    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]

    Any ideas? I did read in a thread that it may be a server issue? Also, I should mention that I tried adding http://www.defamationofcharacter.net to the domain mapping plugin, but it wouldn't let me add it...I'm assuming because it's the primary domain.

    Thank you in advance for your help,

    Ashley Rossi

  2. WPtesting
    Posted 4 years ago #

    Check your wp-config.php file, you will be having something like this,
    define( 'DOMAIN_CURRENT_SITE', 'defamationofcharacter.net ' );
    This line defines your default structure.

    If you want to set www version, just add www before your domain,
    define( 'DOMAIN_CURRENT_SITE', 'www.defamationofcharacter.net ' );

    You may have to modify your mysql entries manually.

  3. issora
    Posted 4 years ago #

    Great, thanks!

    If I don't have any pages setup yet, will I still need to modify the database?

  4. WPtesting
    Posted 4 years ago #

    I'm afraid, yes!

  5. WPtesting
    Posted 4 years ago #

    Why are you trying to set www version?

  6. issora
    Posted 4 years ago #

    Because the www version of the site already has decent SEO ranking - this is an existing domain/website that we just purchased from someone who has been running it since 2008 or 09.

    And I do realize there are differing opinions on how Google treats the two, but I'm not taking any chances. :)

  7. WPtesting
    Posted 4 years ago #

    In that case, you can set your Preferred domain using Google Webmaster Tools instead of changing it. :)
    This option will help Google to understand your Canonical URL.

  8. Because the www version of the site already has decent SEO ranking

    Set up a redirect, 301, from www to non-www (which I THINK WP does for you). You won't lose SEO.

Topic Closed

This topic has been closed to new replies.

About this Topic