I am running into virtual hosts setup issues on MAMP. Here is my vhosts config
I'm not an apache expert. But I had the same problem. I think my DNS doesn't resolve my URL.
When I ping exampl.dev
everything looks fine, but when I enter example.dev in the browser I get an error. I always have to add http:// in front of the url.
Enable virtual host in the right httpd.conf Open MAMP > File > Edit template > Apache > httpd.conf
edit or add:
# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
edit mamp httpd.conf