I am trying to set up two test sites with XAMPP. So here's what I have done:
1. in the httpd-vhosts file I have added:
<VirtualHost *>
DocumentRoot "E:/Projects/site1"
ServerName site1
<Directory "E:/Projects/site1">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot "E:/Projects/site2"
ServerName site2
<Directory "E:/Projects/site2">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
2. I have told to windows (7) with the hosts file that
127.0.0.1 localhost
127.0.0.1 site1
127.0.0.1 site2
THE PROBLEM: when I open with a browser http://site1 or http://site2 both points to the same location: site2. If I change the order in the httpd-vhosts file and I put site2 first, then it will load site1 in both cases. So basically what ever I type (site1 or site2) it points to the location which was specified last in the httpd-vhost file.
Any idea why?
Thanks for your help.