I use XAMPP for local development work. I've had my first virtual domain working well for some time and just decided to add a second. However, when I try to navigate to the second in my browser, it resolves to the first one I set up. When I change the order of my virtual hosts in my httpd-vhosts.conf file then the second domain comes up great, but the first then resolves to the second.
The entries from httpd-vhosts.conf are shown below. Can anyone please tell me where I'm going wrong please? Doubtless it will be down to my idiocy but all help gratefully received.
- Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost dev.lifeofpi.co.uk>
DocumentRoot "C:/xampp/htdocs/lifeofpi.co.uk"
ServerName dev.lifeofpi.co.uk
<Directory "C:/xampp/htdocs/lifeofpi.co.uk/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost dev.cafesejuiced.com>
DocumentRoot "C:/xampp/htdocs/cafesejuiced.com"
ServerName dev.cafesejuiced.com
<Directory "C:/xampp/htdocs/cafesejuiced.com/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Also have my Windows hosts file but I don't think that's the problem.
- Code: Select all
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
127.0.0.1 dev.lifeofpi.co.uk
127.0.0.1 dev.cafesejuiced.com