Reply To: Answer to How to Install WP MultiSite with Top Level Domains

Home Forums Official Forum- Navsingh Answer to How to Install WP MultiSite with Top Level Domains Reply To: Answer to How to Install WP MultiSite with Top Level Domains

#1800 Reply

Nav Singh
Keymaster

In practice this usually means changing the A-records of your domains and point them to your server.

Pick one domain as your primary domain and add it to the server. For the other ones you can create virtual hosts under this primary domain.

In Direct Admin you would first add a new domain and then go to Admin level > Custom HTTPD Configurations and select your primary domain. You can now add the virtual hosts:

ServerAlias secondarydomain.com www. secondarydomain.com

Install WordPress Multisite

Install WordPress and follow the instructions on how to enable WordPress Multisite.

When asked if you want to use subdomains or subdirectories choose subdomains.

If you installed your primary domain using the www-prefix, a warning will appear when you enable Multisite: We recommend you change your siteurl to example.com before enabling the network feature. Personally I always ignore this warning and have never experienced any problems.
Map your domains

When WordPress Multisite is up and running you can start adding new sites. By default they will use a subdomain like subdomain.example.com. To change this to a top level domain, choose Edit site as Network Admin and specify the domain name you want to use on the info tab.

Also add one more line to your wp-config.php file: define(‘COOKIE_DOMAIN’, ”);
To www or not www

If you´re prepending your domains with the www subdomain, you´ll want to redirect the non-www versions of your domain to the www versions. On a single install WordPress takes care of this, but in a Multisite environment I´ve always had to do this manually.

For each domain you´re using, add the below redirect in your .htaccess file (changing example.com to your domain):

RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http: //www.example.com/$1 [R=301,L]

You should now have a Multisite install with seperate domain names.

  • This reply was modified 2 years, 7 months ago by  Nav Singh.
Official Forum

This is the Official Forum of Navsingh a community that helps you find answers to all of your problems,they can be Java/programming,wordpress,android, android programming, seo related or technology related