I update my /etc/hosts file as
127.0.0.1 www.mysite.com
Then in the MAMP's httpd-vhosts.conf, i updated the ServerName as
ServerName www.mysite.com
DocumentRoot /Applications/MAMP/htdocs/mysite
Now, it's working fine. So when I input mysite.com in the browser, it shows the index.html that is inside my folder /Applications/MAMP/htdocs/mysite.
My question is, when I first check the internet on how to create virtual host in MAMP, the examples never use www. in the MAMP .conf file above. So what I did, I remove the www. in the /etc/hosts file and remove also from ServerName in MAMP's .conf file. Now it doesn't work. So do we really need to add the www. in these files?
Another question is since I want to put the index.html inside /Applications/MAMP/htdocs/mysite/public_html, so what I did is I set the DocumentRoot to /Applications/MAMP/htdocs/mysite/public_html instead. Is this correct? It seems to work. Sorry for the confusion I'm kinda new to this thing.
www.prefix does not have any special meaning but many people love typing it every time. You could as well start all your URLs withlittleyellowbird.if you wish. - Álvaro Gonzálezmysite.comin both hosts file and vhosts.conf. when i writemysite.comin safari browser, i got blank page. safari automatically prefix with www. - iPhoneJavaDevmysite.comin /etc/hosts... then i setwww.mysite.comas ServerName then i setmysite.comas ServerAlias in vhosts.conf... it didn't work - iPhoneJavaDev