Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm not sure if this is a problem specific to how my hosting is structured or not.

Let's say the main domain for my account is maindomain.com (for purpose of discussion)

I am building other sites, e.g. anothersite.com and website.com

The folder/directory structure on my hosting would therefore be:

maindomain.com (root)
+---> anothersite.com (subfolder)
+---> website.com (subfolder)

The domains are mapped such that they map to their respective folders. So for example, anothersite.com takes the visitor to the index.php in the folder anothersite.com

However, in Google, as well as just search results for these sites and their content - anothersite.com and website.com (what I want), I also see results that include:



Obviously this is not the way I want search data for these sites to occur. I would like them to be omitted from the search results.

How can the hosting be configured so that the results for each of these respective domains are separate, i.e. not concatenated, so if I search for items relating to these respective sites, I only get results for anothersite.com relevant to it, same for website.com and same for maindomain.com - also used itself.

Such a solution to this problem should not damage the results that I do want to see.

I'm aware of robots.txt but I'm not sure what I need to put in these to stop the mixed-up/concatenated searches without damaging the real results. Or even if all search engines obey them. Is there something I can also do with .htaccess ?

As it is shared-hosting, I don't have complete control over how the folder/directories are structured for this hosting so I would have to stick with the structure but ideas as to how to get desirable search results are welcome.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I'd advise you to add a rewrite rule to your webserver configuration so that URLs are rewritten thusly:

maindomain.com/anothersite.com --> anothersite.com
maindomain.com/anothersite.com/page.html --> anothersite.com/page.html

With a 301 Moved Permanently redirection.

This should cause Google to correct this as pages are recrawled.

You could also add these folders to your main domain's robots.txt file and forbid Google from crawling them (and rely on it finding that material again or promoting the 'direct' version). You can speed this up by using Google Webmaster to remove these folders from the main domain (although it is anyones guess as to how long it will take for the 'direct' sites to show up on their own in Google).

share|improve this answer
+1 @Kris thanks - this looks good! If I do this, how long before Google etc update their listing/indexing? I hope to accept your answer after trying it out, I've edited Apache directives in .htaccess before. –  therobyouknow Jan 9 '12 at 16:34
Specific .htaccess directives needed might be these: webmasters.stackexchange.com/a/16816/3738 –  therobyouknow Jan 9 '12 at 16:48
@therobyouknow How long it takes depends on how often Google crawls your site. Could be a few days, could be a few weeks. No good way to tell. –  Kris Jan 9 '12 at 16:55
+1 Thanks @Kris for the info. –  therobyouknow Jan 9 '12 at 16:57
Accepted - I think this answer is on the right track for me. –  therobyouknow Jan 9 '12 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.