Localhost Setup
Edit your hosts file to account for all subdomains that are contained in the multisite package and then install to localhost.com which you set up as an alias for localhost.The hosts file locationon windows is: “C:\Windows\System32\drivers\etc” and on MAC” and on MAC “/private/etc/hosts”. For example if you have a package with amultisite containing subsites myoriginalsite.com, sub1.myoriginalsite.com and sub2.myoriginalsite.com.
To install this multisite on localhost do the following:
- Open your hosts file in a text editor.
- Add the following to the hosts file:
127.0.0.1 localhost.com
127.0.0.1 sub1.localhost.com
127.0.0.1 sub2.localhost.com - Save the hosts file
- Browse to http://localhost.com/installer.php and proceed with the install.
After the installer completes you should be able to properly view localhost.com, sub1.localhost.com and sub2.localhost.com.
Hosting Provider
When working with a public facing server make sure you have set up wildcard DNS if you haven’t already (or create specific DNS records for each subdomain site).The article Configuring Wildcard Subdomains explains how to set up wildcard DNS for use with multisite.