-
Open up
httpd.conf
(/Applications/MAMP/conf/apache/httpd.conf) -
Uncomment the line under Virtual Hosts:
Looks like this:
# Virtual hosts #Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
Should look like this:
# Virtual hosts Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
-
Open up
http-vhosts.conf
(/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf) -
Remove all example entries except this
NameVirtualHost *:80
. -
Now add the following lines to your file:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/Users/myusername/mysite/" ServerName example.com ServerAlias example.com *.example.com # You can uncomment the below line if you need to specify where your log file goes # ErrorLog "logs/dummy-host.example.com-error_log" <Directory "/Users/myusername/mysite/"> Options Indexes FollowSymLinks Includes AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
-
You can add as many of the above as you need changing the DocumentRoot, ServerName, ServerAlias and Directory entries accordingly.
Last active
August 29, 2015 14:18
-
-
Save hitautodestruct/76e063f2064fd2481fb3 to your computer and use it in GitHub Desktop.
How to configure MAMP on OSX to allow for vHosts file and multiple domains
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment