How Does robots.txt Behave on Domains and Subdomains?

Jun 18, 2007 - 9:36 am 0 by

In a Google Groups thread, a member has set up a subdomain on a domain and has duplicate content on the main domain:

in a nutshell, domainB.domainA.com and domainB.com is pointing to the same content

To avoid duplicate content issues, he's looking for a way to implement the robots.txt file so that the subdomain (domainB.domainA.com) is not indexed by Google, but that the main domain itself (domainA.com) is still indexed.

Bergy, one of Google's newest Webmaster Central representatives, offers some insights.

When a spider finds a URL, it takes the whole domain name (everything between 'http://' and the next '/'), then sticks a '/robots.txt' on the end of it and looks for that file. If that file exists, then the spider should read it to see where it is allowed to crawl.

In your case, Googlebot, or any other spider, should try to access three URLs: domainA.com/robots.txt, domainB.domainA.com/robots.txt, and domainB.com/robots.txt. The rules in each are treated as separate, so disallowing robots from domainA.com/ should result in domainA.com/ being removed from search results while domainB.domainA.com/ remains unaffected, which does not sound like not something you want.

When in doubt, Bergy suggests that you use the Google robots.txt Analysis Tool to see if robots.txt is doing what the webmasters would typically expect.

Forum discussion continues at Google Groups.

 

Popular Categories

The Pulse of the search community

Follow

Search Video Recaps

 
Google Core Update Rumbling, Manual Actions FAQs, Core Web Vitals Updates, AI, Bing, Ads & More - YouTube
Video Details More Videos Subscribe to Videos

Most Recent Articles

Search Forum Recap

Daily Search Forum Recap: March 18, 2024

Mar 18, 2024 - 4:00 pm
Google Updates

Google Urges Patience As The March 2024 Core Update Continues To Rollout

Mar 18, 2024 - 7:51 am
Google

Official: Google Replaces Perspective Filter With Forums Filter

Mar 18, 2024 - 7:41 am
Google Maps

Google Business Profiles Now Offers Additional Review After Appeal Is Denied

Mar 18, 2024 - 7:31 am
Google Maps

EU Searchers Complaining About Google Maps Features Changes Related To DMA

Mar 18, 2024 - 7:21 am
Google

Google Showing Fewer Sitelinks Within Search

Mar 18, 2024 - 7:11 am
Previous Story: What's the Best Format to Name Images for Search Engines?