Skip to content

Instantly share code, notes, and snippets.

@levymetal
Last active November 1, 2022 02:36
Show Gist options
  • Save levymetal/5083884 to your computer and use it in GitHub Desktop.
Save levymetal/5083884 to your computer and use it in GitHub Desktop.
Tutorial on how to use vhosts & MAMP, full post available at @ https://christianvarga.com/vhosts-and-mamp/
127.0.0.1 project1.localhost
127.0.0.1 project2.localhost
# Enables localhost/project-name to be used, if you want.
<VirtualHost *>
DocumentRoot "/Users/your-username/sites/"
ServerName localhost
</VirtualHost>
# vhosts for each project
<VirtualHost *>
DocumentRoot "/Users/your-username/sites/project1/"
ServerName project1.localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Users/your-username/sites/project2/"
ServerName project2.localhost
</VirtualHost>
# Virtual hosts
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
# Alias /favicon.ico "/Applications/MAMP/bin/favicon.ico"
# Alias /icons/ "/Applications/MAMP/Library/icons/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment