Jump to Navigation Jump to Main Content Jump to Footer
Home » Docs » Installation / Setup » Wildcard Virtual Hosts

Wildcard Virtual Hosts

Setting up wildcard virtual hosts allows you to automatically access each new local WordPress project under its own custom domain (e.g. myproject.test), without manually editing your system’s hosts or web server configuration for every new site. This greatly speeds up local development and keeps your environment organized.


Why use wildcard virtual hosts?

  • Zero config: No manual changes for each project—just start coding.
  • Custom local domains: Every site gets a memorable, separate .test domain.
  • Professional workflow: Works especially well for multisite and team development.

macOS Setup

Chisel recommends using the dnsmasq tool via Homebrew for wildcard DNS resolution.

This tutorial assumes you have MySQL and Apache installed (they come by default with macOS). If you use MAMP, use it as you like, but this tutorial aims for a built-in Apache & MySQL setup. You can find additional information about where MAMP stores its config files in this article.

Steps:

  1. Install prerequisites:

Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Bash

Xcode CLI tools (if not installed):

xcode-select --install
Bash
  1. Install and configure dnsmasq:
brew install dnsmasq
echo 'address=/.test/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
sudo mkdir -p /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/test'
Bash

On Apple Silicon Macs, Homebrew’s prefix may be /opt/homebrew instead of /usr/local. Adjust above commands if needed.

  1. Apache configuration:

Uncomment LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so in /etc/apache2/httpd.conf.

In /etc/apache2/extra/httpd-vhosts.conf add:

<VirtualHost *:80>
  ServerAlias localhost *.test
  VirtualDocumentRoot /Users/YOUR_USERNAME/Projects/%1/wp
  UseCanonicalName Off
  <Directory "/Users/YOUR_USERNAME/Projects">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
Text

Restart Apache:

sudo apachectl restart
Bash

Windows Setup

Wildcard local domains are supported via Acrylic DNS Proxy:

  1. Install Acrylic DNS Proxy and follow the included setup guide for your Windows version.
  2. Edit the Acrylic hosts file (AcrylicHosts.txt) to include:
127.0.0.1 *.test
Text
  1. Configure Apache/Vhosts (in XAMPP or similar):

Uncomment LoadModule vhost_alias_module modules/mod_vhost_alias.so in httpd.conf.

In httpd-vhosts.conf, add:

<VirtualHost *:80>
  ServerAlias *.test
  VirtualDocumentRoot C:/xampp/htdocs/%-1/wp
  UseCanonicalName Off
  <Directory "C:/xampp/htdocs">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
Text

Restart Apache via XAMPP control panel.


Linux Setup

Tutorials for setting up wildcard DNS and Apache vhosts on Linux are available online and follow a similar approach—configure DNS resolution and add wildcard vhost rules in your Apache/Nginx configuration.


Usage

  • Projects in your configured directory (e.g. ~/Projects or C:/xampp/htdocs) will be available at projectname.test.
  • Chisel configures BrowserSync to proxy each site at its respective .test domain.
  • For best results, name your project folder to match the desired domain name.

Tip: Use .test for all local domains. It is reserved for testing by the IETF, making it the safest and most conflict-free choice.

Do you like Chisel?

Give it a star on GitHub!