Question

I have a VPS Hosting account with 2 domains. I just looked on Google to view the pages indexed for one of the sites and noticed that one of the results was one of my nameservers. As far as I am concerned, Google should not be indexing this.

Additionally, when you click on the link and go to it, the page loads as the 2nd website's home page. I fear that this is a problem for 2 reasons... 1- Duplicate Content, 2- Associating content between 2 sites.

Name Servers: NS1.DOMAINA.COM NS2.DOMAINA.COM

Domains: DOMAINA.com DOMAINB.com

When I clicked on NS1.DOMAINA.COM and NS2.DOMAINA.COM, they both pulled content from DOMAINB.COM. The nameservers are being indexed as DOMAINA.COM pages however.

After reading several resources, it seems that this issue resulted in band-aid fixes such as robots.txt rules, etc. I would rather fix the problem but if that is not probable, I would prefer to do this in .htaccess. However, I am nor exactly proficient in htaccess so I would require examples or detailed explanations.

Thank you

Était-ce utile?

La solution

Add a file named robots.txt at the root of the domain you wish to remove the indexation, and fill it with this:

User-agent: *
Disallow: /

You can also set this bunch of lines on your .htaccess :

Header set X-Robots-Tag "noindex, nofollow"

EDIT: Also, to block only the subdomain, add a rewrite rule:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^DOMAINA.COM$
RewriteRule ^robotx\.txt$ robots-subdomain.txt
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top