I use MAMP Pro for my Mac OS localhost WordPress development environment. Lately, I’ve been working with a few WordPress multisite subdomain installs, and I’ve been frustrated without the inability to setup a local Wildcard DNS using the
Hosts > General > Aliases
option. Luckily, I found a work-around to enable Wildcard DNS on my localhost for each Host
I have set. Here’s how I did it:
Follow These Steps
- Open up MAMP Pro
- Go to:
File -> Edit Template -> Apache -> httpd.conf
- Search for this line:
ServerName MAMP_VirtualHost_ServerName_MAMP
- Add this directly below it:
ServerAlias *.MAMP_VirtualHost_ServerName_MAMP
- Restart MAMP.
That’s it, you now have a localhost wildcard DNS setup for your MAMP Pro development environment.
Be aware
This will automatically add a wildcard ServerAlias
to all your MAMP Pro hosts, which you may or may not want depending on your situation.