Maintain WWW prefix in domains added to multisite (15 posts)

  1. tradiart
    Posted 5 years ago #


    I'm really sorry for asking this twice, I know this is not practical but I suppose in this forum I will get an answer.

    I have published also my question here:


    I'm migrating several WP 3 blogs to a unique multisite installation using the "WordPress MU Domain Mapping plugin".


    I have followed these instructions:


    Everything seems to work fine, except for the detail that I need to maintain the WWW prefix in all domains (domains without www are working fine). All my sites are aged and always have used the www prefix.

    Here there is a closed post with a solution:


    I wouldn't prefer not to touch or modify the plugin code, as I want to benefit from futures upgrades.

    Is there a solution using only the htaccess file in root folder?

    That would be amazing!!

    Thank you!!

  2. So... when you migrate over the blogs and map the domains, is the domain mapping plugin keeping the www or stripping them out?
    Have you tried going to Super Admin -> Sites then Edit and fill in the www?

  3. tradiart
    Posted 4 years ago #

    Hello Andrea,

    Sorry for not answering to your question, dindn't receive email notification.

    Yes, in Super Admin > sites, the www is present in front of the domain.

    When I visit the domain without www, it takes too long... and never loads anything, just waiting. Then, a message, seems the page is not redirecting correctly.

    In Super Admin > Domain Mapping Configuration I have all options active. That's the only way everything works.

    This is the content of htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    This happens with main domain and the domains added to network.

    Thank you!

  4. And on the server side, when you parked/ aliased the domain you wanted to map, did you include the www or not?

    At this point,. it's all to do with the server settings.

  5. tradiart
    Posted 4 years ago #

    The second domain is added without www. I have redirected now to http://www.domain.com, in CPanel, but the result is the same...

  6. Check your server DNS records.

  7. murokoma
    Posted 4 years ago #

    Hi Andrea,

    as I have the exact same issue, I've checked with my hosting company, here's the answer I got:


    DNS has nothing to do with anything in your browser other than what it resolves to. The www CNAME already exists and is configured correctly.

    $dig -t CNAME http://www.onlinemarketinghome.com

    ;www.onlinemarketinghome.com. IN CNAME

    http://www.onlinemarketinghome.com. 14387 IN CNAME onlinemarketinghome.com.

    onlinemarketinghome.com. 14387 IN A

    It is possible to create a CNAME for each subdomain/site created. The record would look like the following:

    http://www.subdomain in CNAME onlinemarketinghome.com.

    The above will not force anything to load and would be redundant because if it weren't created it would still work because of the www CNAME configured as shown above is pointing to the same place along with the wild card subdomains that should be configured.

    Unfortunately to accomplish this you will need a complex rewrite rule which may conflict with WordPress itself and possibly cause an infinite redirect loop. The coding is not something we can support.

    Any other ideas? Thank you very much,

  8. What host are you on?

  9. murokoma
    Posted 4 years ago #

    SEOhosting.com, which is the "seo specialised" branch of hostgator.

  10. You know they gave you an answer to include the www, when your issue is the opposite?

    If they can't manage to be able to point both the www and the non www to a folder on the server, then I'd start looking elsewhere. Even the basic hostgator packages are better than that.

  11. tradiart
    Posted 4 years ago #

    Oh my, of course we are doing something wrong :-(

    After upgrading to 3.1.1, the situation has changed a bit.

    Main domain for me is working fine. Non-www main domain redirects to main domain. Nice :-)

    maindomain.com to http://www.maindomain.com :-)

    But other domains in network without www redirect to main domain.

    netdomain.com to http://www.maindomain.com :-(

    Andrea, this must be something related to htaccess rules, DNS records must be fine, right?

    The htaccess seems identical....

    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]

    Hope this brings some clarification to the problem.

  12. But other domains in network without www redirect to main domain.

    netdomain.com to http://www.maindomain.com :-(

    Andrea, this must be something related to htaccess rules, DNS records must be fine, right?

    No, it's not htacess. There's only one for all sites.

    If those other domains are mapped domain, and the NON www version of those mapped domains to those sub sites.

    Visit the sites in question.
    Look under tools -> Mapping.
    make sure both the www and non www are there. Pick one to be the primary domain for that site.

  13. PhilEsq
    Posted 4 years ago #

    Hi Andrea,
    If you remember, I had asked you about the same issue with my site LawFirm911.comâ„¢. When mapping a domain, it shows a field at:
    Add new domain
    http://www. [ ]

    Consequently, I cannot add in www. because it is already there.

    Now, I need to create a few sites for a friend of mine and I wanted to make it easier for me so I clicked on Network Setup under Tools and it shows the following notice:

    We recommend you change your siteurl to jonathanwinston.com before enabling the network feature. It will still be possible to visit your site using the www prefix with an address like http://www.jonathanwinston.com but any links will not have the www prefix.

    I'm not sure if I should change it or leave it alone and why it is recommended that I change it.

  14. You can ignore it and force the www server side.

  15. PhilEsq
    Posted 4 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic