Multiple Sites Problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Multiple Sites Problem

Postby thomas_solutions » 01. August 2010 19:38

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.
thomas_solutions
 
Posts: 2
Joined: 01. August 2010 19:32

Re: Multiple Sites Problem

Postby Nobbie » 01. August 2010 20:21

thomas_solutions wrote:Any idea why?


This question has been asked approx. a million times, and the solution is the same as for the other 999999 times. It is always lack of reading documentation and it always lacks the NameVirtualHost Directive.

Why does nobody (including you) read documentation?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Multiple Sites Problem

Postby thomas_solutions » 02. August 2010 12:49

Thank you... this has sorted out the problem. Unfortunately I have lots of forums, and they all suggested only what I have added to my post.

But anyway, this works perfectly, so thanks again.
thomas_solutions
 
Posts: 2
Joined: 01. August 2010 19:32


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 124 guests