Skip to content

Instantly share code, notes, and snippets.

@tjoskar
Last active December 17, 2015 23:29
Show Gist options
  • Save tjoskar/5689580 to your computer and use it in GitHub Desktop.
Save tjoskar/5689580 to your computer and use it in GitHub Desktop.
Add a new virtual hosts for MAMP

How to add a new virtual hosts for MAMP


First, edit your hosts file.

$ sublime /etc/hosts

Add your new host, ie.

127.0.0.1 example.dev

Edit your (MAMP-) apache httpd.conf file

$ sublime /Applications/MAMP/conf/apache/httpd.conf

And add the new host

NameVirtualHost * (add this line just once)
<VirtualHost *>
  DocumentRoot "/path/to/your/project/"
  ServerName example.dev
</VirtualHost>

Restart MAMP and you are good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment