Multisite on Windows with wildcard subdomains

I want to create a local network on a Windows machine using subdomains. I do not want to edit the hosts file for each new subdomain. But Windows does not support wildcard subdomains, and the Codex doesn’t say anything useful about this topic.

What should I do?

Solutions Collecting From Web of "Multisite on Windows with wildcard subdomains"

There is a plugin for that: WP XAMPP Multisite Subdomains. Unfortunately, there is no English description available. I’ll try that here.
The following guide will set up a multi-site under mu.wp with subdomains.

1. Basic Installation

Start with a fresh installation of WordPress and XAMPP. Create a network for subdomains. Do not create any sub site yet.

My XAMPP is installed in E:\xampp, WordPress in E:\, and my site specific directories in F:\sites. There is a directory F:\sites\_logs for log files.
Make sure to adjust the paths in the following examples to your set up.

2. The hosts file

Open the hosts file. On Win 7 that’s probably on C:\Windows\System32\drivers\etc\hosts, and you need administrator rights to edit it.

Create a separate section like this:

# BEGIN XAMPP-           mu.wp

Note we use, not This is important.

Save the file, close and forget.

3. The httpd-vhosts.conf

Open the Apache vhosts file in /apache/conf/extra/httpd-vhosts.conf.

Create a new virtual host. If that is your first virtual host you need a generic vhost first.

generic vhost

Should be the first virtual host in the file.

<VirtualHost *:80>
    DocumentRoot "E:/xampp/htdocs"
    ServerName localhost
    <Directory "E:/xampp/htdocs">
        Options Indexes FollowSymLinks
        Options +Includes
        AllowOverride FileInfo
        AllowOverride All
        Order allow,deny
        Allow from all
        DirectoryIndex index.php index.shtml index.html index.htm
    ErrorLog  "F:\sites\_logs\default.error.log"
    CustomLog "F:\sites\_logs\default.access.log" combined

our multi-site vhost

    ServerName      mu.wp
    DocumentRoot    "E:\"
    <Directory "E:\">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    ErrorLog        "F:\sites\_logs\mu.wp.error.log"
    CustomLog       "F:\sites\_logs\mu.wp.access.log" combined

Make sure all the paths are correct! Restart Apache.

4. Install the plugin

Install the plugin WP XAMPP Multisite Subdomains as a MU-plugin. Usually in wp-content/mu-plugins.


You can create new subdomains now in http://mu.wp/wp-admin/network/site-new.php, the plugin will update the hosts file automatically, and your new sites are available immediately.