I have a WordPress MultiSite setup with multiple domains using the same install. I am using the plugin Networks for WordPress to achieve this.
WordPress is already configured to remove all www, which is good for subdomains, but I would like to configure all root sites to use www. (Leaving the subdomains without www.)
Now my problem is that in such a setup there is only one .htaccess file that seems to be shared by all sites in the network (regardless of what domain they belong to).
Also any redirection from .htaccess would require to first disable the default WordPress redirection for root sites. (Otherwise I’ll end up with an endless loop.)
So is there a way to redirect multiple non-www root sites to www, all from the same .htaccess file? And how to disable the default WordPress redirection to non-www for root sites only? Anything else required to get this working?
PS. Unfortunately, I don’t have direct access to Apache or DNS configuration, so I can’t use these methods instead of .htaccess.
Try adding this in the htaccess file in your document root, above any wordpress rules that might be in there:
As long as your “root sites” have domain names that only have one
.
in them (e.g. domain.com, domain.net, domain.us), it’ll redirect those all to redirect with awww
in front.