Forum Moderators: phranque
I have a friend with several sites hosted on a virtual hosting i.e. he has a shared hosting account at Westhost with the facility of adding other sites to his account.
So, he added two sites, and created a site2 folder and site3 folder and dumped all his site2 and site3 files in there and they resolve OK i.e. you type site1.com and you get the expected stuff in your browser window. But Google has now indexed those sites as directories of site1. Google has picked up site1.com/site2/content.htm and site1.com/site3/content.htm.
How does he separate this in .htaccess? And have them all show up with the "www" version only?
TIA
Also, I understand sub-domains as taking the form subdomain.mysite.com. I don't know if my OP suggested there were subdomains but there aren't.
Quite simply there are three sites called site1.com, site2.com and site3.com. Because they are all hosted on the same account you get one single FTP login and one single directory tree into which you need to put the files for all three sites. So, in the "main" folder you post the files for site1.com and within that folder you create a site2 and site3 folder for files relating to those other sites. Your control panel allows you to associate each domain to the folder for that domain. So when a visitor types ww*.site2.com/content.htm then the file that's in the site2 folder with the name "content.htm" is served up.
The problem is that you can also access that file by typing site1.com/site2/content.htm. And Google is doing just that. I'm hoping to solve that by having a htaccess that redirects site1.com/site2/content.htm to htt*://ww*.site2.com/content.htm. And to do the same for site3.com
Apologies in advance if it hasn't been explained very well.