I have hosted several websites in an old server, now I want to move them to new server. Before switching DNS I want to test whether everything works fine in new server. For this, I copied all the websites to my new server. I then configured new server's Virtual Host
with NamedVirtualHost
Enabled as follows.
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/server/www"
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "c:/server/www/siteone"
ServerName siteone.com
ServerAlias www.siteone.com
<Directory "c:/server/www/siteone">
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "c:/server/www/sitetwo"
ServerName sitetwo.com
ServerAlias www.sitetwo.com
<Directory "c:/server/www/sitetwo"
AllowOverride All
</Directory>
</VirtualHost>
Lets say IP of new remote server is 10.10.10.10. I then edited host
file of remote server to enter 10.10.10.10 www.siteone.com
. I checked it works there.
Now i wanted to check it from my local machine (not remote). I edited host
file of my local machine to include 10.10.10.10 www.siteone.com
. But it always loaded from original location(from the place where it is live currently.) . I tried flushing DNS, clearing browser cache, restarting browser. But all in vain. but how ever if I browse 10.10.10.10 from my local machine, it lists the folders of document root i.e. C:\server\www
. Where might I be doing wrong? Can anybody help me please.
EDIT: My host file
10.10.10.10 siteone.com
10.10.10.10 www.siteone.com
10.10.10.10 sitetwo.com
10.10.10.10 www.sitetwo.com
P.s. If i ping www.siteone.com then it gives correct IP 10.10.10.10
Server has Windows 2008 R2, and my local computer has windows 7 pro.
Thanks A lot