HI, I have two domains hosted with the same ip address on Debian vps using apache virtualhost feature. (here I replaced the my real domain names with example1.com and example2.com and my real ip replaced with xxx.xxx.xxx.xxx).
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/var/www/example1"
ServerName example1.com
ServerAlias www.example1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/example2"
ServerName example2.com
ServerAlias www.example2.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www"
ServerName xxx.xxx.xxx.xxx
</VirtualHost>
here I created the third virtual host with my ip address because I wanted to point all direct requests to my ip address to go to index.html file in the /var/www folder.
Everything works fine. www.example1.com and example1.com really points to my /var/www/example1 domain when I type those urls with my browser. www.example2.com and example2.com really points to my var/www/example2. When I type ip address in browser it points to /var/www/.
But When I search google image search with site:example1.com, images from example2.com appears as they were in example1.com. Another weird thing it says the images are from www5.example1.com. When I click on thumb and then click the "Website for this image" link in the next screen it redirect to the page of example2.com site where actual image resides.
how could this happen? . I have never created any subdomain called www5 in my site.apparently google see the contents of example2.com as www5.example.com. I think there is an error with my apache configuration. Please help..