Multisite on Windows with wildcard subdomains

The question:

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?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

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, 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:WindowsSystem32driversetchosts, 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_logsdefault.error.log"
    CustomLog "F:sites_logsdefault.access.log" combined

our multi-site vhost

    ServerName      mu.wp
    DocumentRoot    ""
    <Directory "">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    ErrorLog        "F:sites_logsmu.wp.error.log"
    CustomLog       "F:sites_logsmu.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.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment