
I would like to test if it works to serve more websites from one Wordpress installation. By default Wordpress supports subdomains (like Wordpress.com) but I would like to run the installation with second-level domains (SLD). This is described in this article. Maybe in the future Wordpress will support SLD, in that case I will report that in this article.
Yes, I know there are a lot of other howto’s about to install Wordpress Multisite. I did not find a correct one and it confused me. To install Wordpress Multisite for SLD is not complex, it is robust, but there are some tricky things that you need to know. That is why I wrote this article. Ok, let’s start!
If you not already installed, you can do a default installation on your domain. No special things at all. Since Wordpress 3.0, multisite is integrated in the regular version of Wordpress.
The DNS needs to be enable for wildcards before your domain name. Currently I like to test it on my local machine. The complete configuration for DNS and WAMP locally is described here: Adding wildcard domains dns to local WAMP How to configure this on your live webserver depends on your provider. Please ask them for this.
All the domains you are going to use, needs to point to the same directory. You can find an example here: Adding wildcard domains dns to local WAMP
Login into your admin page of your site. To enable Multisite in Wordpress you need to add the following line to wp-config.php:
define('WP_ALLOW_MULTISITE', true);
Now press F5 in your browser to refresh your admin page. Go to new menu Tools->Network Setup and leave the settings by default. We need Sub-domains and this is selected. Press Install
Now perform the suggested three steps:
Again press F5 in your browser. You can have the message that you are leaving this page, ignore it. Now you need to login again, you are now Network Admin!
To add the missing functions to map SLD domains, we are using the plugin WordPress MU Domain Mapping. Go to the plugins menu and add the plugin: WordPress MU Domain Mapping Then you need to click on Network activate
After that you need to copy sunrise.php from the directory: wp-content\plugins\wordpress-mu-domain-mapping to the wp-content directory.
To finish the plugin installation you need to add the following line to wp-config.php:
define( 'SUNRISE', 'on' );
Go to menu: Settings->Domain mapping.
In the field Server IP Address, fill in the IP nr of the server. In my case for the test is this: 127.0.0.1
Select the Domain Options:
And deselect the Domain Option:
Press the button Save
Go to menu: Sites->Add New
Because Wordpress Multisite supports only subdomains, this page is like we are adding a subdomain. Fill in the fields:
Press the button Add Site
Now click in this page Edit site
Press the button Save Changes
Click on the tab Settings, and search for Fileupload:
Press the button Save Changes
For the Domain settings we need to now which Site ID every site has. Normally it starts with 2 and further, but you can check this by doing the following.
Go to menu: Settings->Domains
Press the button Save
Now you are able to access the site and the admin pages of the added domain.
On a Linux machine I should see make a symbolic link, but for Windows is that not the case. Because when updating the plugin, the sunrise.php file needs to be updated by copy the file again.