1

My site is indexed with my another domains, all of the domain are hosted in same hosting.

When I search with site:me.example.com it indexed the another domain like this me.example.com/site1.example.com. How do I handle this situation?

Note: I have 5 websites in same hosting, when I search with site:me.example.com it shows all the websites in suffix like the below example:

  1. me.example.com/site1.example.com
  2. me.example.com/site2.example.com
  3. me.example.com/site3.example.com
  4. me.example.com/site4.example.com
  • Why do they show on that page, what kind of page it me.example.com? Is it one of those compare-sites? If so, you could contact them (backlinks from those types of sites aren't worth that much anyways) – Martijn Apr 19 '14 at 12:26
  • @Martijn that is my site only, i just redirect that domain to another, don't know why it is merged with other sites. How do I stop indexing with other sites ? – Bala Apr 19 '14 at 12:35
  • @Martijn I updated my question, hope it is clear now! – Bala Apr 19 '14 at 12:42
  • This is still very vague. That referring website, is that yours? If I visit me.example.com/site2.example.com do I immediately get forwarded to site2.example.com? If the last case is true, just add a header 301 or 302 to it – Martijn Apr 19 '14 at 14:20
  • I think in order to answer your question we would need specific information such as the web server software (Apache for example) and some clues to the configuration such as configuration files (you can remove domain names and IP addresses). – closetnoc Apr 19 '14 at 15:35
1

I think that you may have created your sites using a control panel. I say that because many of them have more than one way to create a site, one of which appears to be exactly what you have. It is a confusing mish-mash of site and user sites where one site was created first and the others were created using the same username later. This in of itself is not wrong, but there are two options with this where one creates user sites under the parent site which I think is what happened here. I would not worry about the details of this just yet. I would suggest that you familiarize yourself with the control panel for the future.

The good news is that there is an answer!

While I cannot look into a crystal ball and know exactly what has happened and what your configuration looks like, I am pretty sure I can tell you what your configuration should look like.

In the directory /etc/apache2/sites-available or /etc/local/apache2/sites-available, you will find configuration files with file names something like domainname.tld.conf. You will want to edit each of these. I suspect that there is overlap in the DocumentRoot and Directory directives between your configuration files. You do not want overlap in this- not for what you have described.

You should see something like this:

<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /home/mydomain.com/www
AddHandler cgi-script .php
DirectoryIndex index.html
<Directory /home/mydomain.com/www>
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All
</Directory>
</VirtualHost>

There may be other directives and specifications. I would not worry about that. The ones I want you to pay attention to are DocumentRoot and Directory. You will notice that they are the same in this case. This is exactly what you want. For each site configuration, you want your website to be in a unique directory. I suggest a format like you see above where /home/site1.com/www, /home/site2.com/www, /home/site3.com/www, etc. are for each site. Of course you change the various site# files to what your domain names are.

You will have to use the cp command to copy your site from one location to the next. You may have to use chown to change ownership, chgrp, to change group ownership, and chmod to ensure that permissions are set correctly. If you are not sure how to do this, then I suggest using something like man chown and reading the manual and being very careful not to destroy the old directory scheme and to create a new directory scheme to make sure you get it right. You may have to change any /cgi-bin/ directory directive and directory permission and redeploy any permissions which are often different from the site. Make sure if you use ls to list a directory, that you use ls-al to make sure you can see any .htaccess and other hidden files. Do this work carefully. It is easy to do, but even a seasoned *nix user can goof it up from time to time. But then again it is also easy to fix too so don't worry too much.

If you have any CMS, blog, or other application installed, you will need to research how to change the directory that it uses within the configuration. Often this is a simple change in a configuration file as well and perhaps some permission considerations.

Once you have created each directory and you are sure that the file permissions are correct, then change the configuration files. This is the last step except clean-up. If there is a problem, you can fix it quickly or drop back and punt- setting the site configuration file back to the old directory until you have fixed the problem. Only after you feel that your sites are running the way you want them too and you do not need the old directories anymore, then you can back them up for safe keeping and delete them from your hard drive.

I hope that I got it all okay. Let me know if you have any questions. I can update this answer for you or respond in the comments.

1

That's because of all of your websites are hosted in same place. me.example.com/ is your main domain and other 5 domain are add-on domain those acting like subdomain for me.example.com/ . You have to tell Google or other Search engine by editing .htaccess to not to index as sub domain of main domain. But to index as individual domain .

Also it's bad practice for hosting server security.

  • thanks ibrahim, can you please give one example on how to declare in .htaccess file. I'm unsure to do it. – Bala Apr 20 '14 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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