So now I'm one year later, using MAMP or XAMPP to have them all (like 8 of them) on my local, or at least the new ones, so I'm experimenting with this and it's very interesting.
I've managed to setup two different websites locally, so when I use them without www, it takes the virtual domain saved in my httpd.conf and my hosts. I expected when I use www to be taken to the remote site.
httpd.conf has
- Code: Select all
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin sergio@sergiozambrano.com
DocumentRoot "/Users/sergio/Sites"
ServerName Sites
</VirtualHost>
<VirtualHost *:80>
ServerAdmin sergio@mysite1.info
DocumentRoot "/Volumes/Trabajos/mysite1/site"
ServerName mysite1.info
</VirtualHost>
<VirtualHost *:80>
ServerAdmin sergio@mysite2.com
DocumentRoot "/Volumes/Trabajos/mysite2/website"
ServerName mysite2.com
</VirtualHost>
and hosts is
- Code: Select all
127.0.0.1 mysite1.info
127.0.0.1 mysite2.com
The problem is, when I let the ethernet cable plugged in, the website is read from the web.
Is there any way to force the content to be loaded from the local ip?
Thanks.