This weekend I was trying to set up sub-domains in MAMP Pro to replicate the server set up for a new project I’ve taken on.  Although this task is actually quite straightforward in the end, I couldn’t find any decent documentation on it until this article by Mark Van Der Putten got me going in the right direction.  Thanks Mark!

Meanwhile, in the comments were requests for the step by step to be written up.  Mark obviously hasn’t had the time, so I wanted to jot down these notes for anybody they might help.  So, to create and use sub-domains with MAMP Pro, follow these simple enough steps:

 – open Mamp PRO, click hosts and create a new host that you will use to map for your primary domain

 – choose a Disk Location for this new host, and a server name, say: mydomain

 – now, create another new host that you will use to map for your subdomain, choosing a new disk location whilst you’re there.  (I develop in one folder called ‘code’ and in that I have a new folder for each sub-domain)

 – give this new host a different server name, say: subdomain

 – for this new sub-domain host, click the ‘plus’ sign beneath the aliases box, and create an alias: subdomain.mydomain

 – and that’s it.  Typing subdomain.mydomain:8888 will now map to the new host you set up as the sub domain

Hope that helps somebody.