Using WordPress multisite with MAMP Pro and subdomains
Last modified: 22nd September 2022
This is just a quick tutorial on how to run WordPress Multisite with local subdomains using MAMP Pro v5.3.
Scenario: You have an existing WP Multisite you want to set up locally so you can work on it. Your main site is www.catsarethebest.com. Then you have some other sites attached such as blog.catsarethebest.com and shop.catsarethebest.com and you want to have subdomains working locally too.
Set up your host first
You’ve got your WordPress files ready in a directory, and your database in your local phpmyadmin, you just need a local domain to run it from. Let’s say you want to set up catsarethebest.local
Run MAMP, then click the little + icon (see below) and create a new host. Go through the set up prompts.
Visit your local domain (catsarethebest.local) and check that your WordPress site is running as expected.
Once you have your WordPress site with multisite set up, we want to add the subdomains. These would be blog.catsarethebest.local and shop.catsarethebest.local
Use aliases
If you try and set up your subdomains in the same way as the first host in MAMP, it won’t work. This is because MAMP will only let you use the same destination folder once.
Instead we want to create aliases. You can see where I’ve done that in the screenshot below.
Setting subdomains in Network admin
Once you’ve done this, you’ll need to make sure the subdomains are set correctly within WordPress.
You’ll find these within your WordPress menu. Go to My Sites > Network Admin > Sites
In here you’ll see the sites you want to set the subdomain for (or perhaps you need to set them up if you haven’t already). Just ensure the Site Address (URL) is set to the local subdomain you set up. See below.
Now when you visit your subdomain, you should be able to see the website for that particular site!
Any questions?
Give me a shout on Twitter @jo_loveridge