Virtual hosts not working on MAMP

user6166 picture user6166 · Mar 5, 2015 · Viewed 18.8k times · Source

I am running into virtual hosts setup issues on MAMP. Here is my vhosts config

Here is my hosts file

127.0.0.1       localhost
127.0.0.1       dev.local.com

now when visiting localhost and dev.local.com both are pointing to index of local directory. I tried various config setting in vhosts file but none is working. I am on MacBook Pro 10.10

Answer

Dmitriy Kravchuk picture Dmitriy Kravchuk · Aug 19, 2017

I didn't find any of the answers useful, so if other suggestions don't work for you:

Consider that the virtual hosts need to be correctly enabled/included by uncommenting

Include conf/extra/httpd-vhosts.conf in C:\MAMP\conf\apache\httpd.conf and NOT in C:\MAMP\bin\apache\conf or C:\MAMP\bin\apache\conf\original .

There're multiple locations that have MAMP configuration, make sure to uncomment that line in the correctly located file.