Forum Moderators: phranque
When you go to www.myothersite.com it shows up like that in the browser, but it is actually pulling the files from www.mysite.com/subdomain/myothersite.com
Now, how do I get it so that the search engines index the www.myothersite.com instead of www.mysite.com/subdomain/myothersite.com? Yahoo picked up one of my new sites, but it has it as www.mysite.com/subdomain/myothersite.com instead of www.myothersite.com
Is there something I can do in robots.txt or .htaccess that will prevent this from happening?
Help!
Many folks have vanity domains that all point to the same filesspace, e.g. mysite.com and myothersite.com are identical. This is one thing that normally search engines can work out themselves. They will usually pick one domain and stick with it.
If they start listing both domains, you can use a 301 redirect to force requests for the domain you don't want listed to the domain you do want. (Take a look at the Apache forum, there are many examples there of how to do this).
On the other hand, your post almost makes it sound like the content of each domain is supposed to be different, and you have each of the other domains in a separate directory off the root. The root holds your main domain.
In this case, there's no real reason that a search engine should find domain2.com at domain1.com/domain2.com/index.html (or whatever).
Is it possible that you have a link on your site that has domain1/domain2. In this case, change it to just domain2.com instead. (this link could be on either site)
If this is the problem, you could use robots.txt on domain1 to exclude domain1/domain2 from being indexed. If the robot comes in directly to domain2, it will use that domain's robots.txt, which won't have the exclusion.
I hope this helps.