Go Back   SitePoint Forums > Forum Index > Manage Your Site > Search Engine Optimization > Google
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Nov 25, 2007, 09:15   #1
Datalife
SitePoint Enthusiast
 
Join Date: Sep 2006
Posts: 27
How to make Google not index a subdomain?

Hi forum,

I have got a question, but should be a piece of cake.

I just want to confirm with someone how do I block search engines (all of them) from a testing subdomain?

Lets say my domain is mydomain.com

My subdomain is test.mydomain.com

So, in my robots.txt file...

Should it be like this:

Agent: *
Disallow:/test/

Is the above the right htaccess command and should this be placed in the main public_html folder?

My subdomain redirects to a subdomain not a subdirectory..it redirects to http://test.mydomain.com

Thanks for any clarifications
Datalife is offline   Reply With Quote
Old Nov 25, 2007, 09:30   #2
holmescreek
SitePoint Wizard
 
holmescreek's Avatar
 
Join Date: Mar 2001
Location: Northwest Florida
Posts: 1,699
Yes, your subdomain points to a folder in the main sites document_root folder.

public_html/test/

So, in your public_html folder create a robots.txt to include

User-agent: *
Disallow: /test/

Or, to specifically disallow a particular agent :

User-Agent: Googlebot
Disallow: /test/


Here is a good reference on robots.txt that you can bookmark.
holmescreek is offline   Reply With Quote
Old Nov 25, 2007, 09:45   #3
aaronjj
SitePoint Addict
 
Join Date: Mar 2006
Posts: 380
Each subdomain should have it's own robots.txt file in it's own root directory. To block an entire subdomain you would use
User-Agent: *
Disallow: /

Quote:
Originally Posted by Datalife View Post
Is the above the right htaccess command and should this be placed in the main public_html folder?
No htaccess involved. Just a plain-text file named robots.txt
aaronjj is offline   Reply With Quote
Old Nov 25, 2007, 10:04   #4
Datalife
SitePoint Enthusiast
 
Join Date: Sep 2006
Posts: 27
Thanks!

I wonder why I was away for so long...you Sitepoint guys are so helpful
Datalife is offline   Reply With Quote
Old Nov 25, 2007, 12:31   #5
armchaircritic
8.12.13.18
SitePoint Award Recipient
 
armchaircritic's Avatar
 
Join Date: Nov 2006
Location: Silures
Posts: 2,723
Welcome to Sitepoint Datalife Thanks for posting this thread, I learned something from it too. I should probably do the same for my multiple subdomains on my sites - though I've never bothered to create a robots.txt file as the instructions on google didn't appear very clear to me - perhaps a second look is in order.
armchaircritic is offline   Reply With Quote
Old Nov 25, 2007, 12:37   #6
holmescreek
SitePoint Wizard
 
holmescreek's Avatar
 
Join Date: Mar 2001
Location: Northwest Florida
Posts: 1,699
See my post above, and check out the link. It is about the clearest set of instructions on robots.txt files that I have found.
holmescreek is offline   Reply With Quote
Old Nov 25, 2007, 13:25   #7
aaronjj
SitePoint Addict
 
Join Date: Mar 2006
Posts: 380
Quote:
Originally Posted by armchaircritic View Post
Welcome to Sitepoint Datalife Thanks for posting this thread, I learned something from it too. I should probably do the same for my multiple subdomains on my sites - though I've never bothered to create a robots.txt file as the instructions on google didn't appear very clear to me - perhaps a second look is in order.
IMO there's no need for a robots.txt if you don't want to block anything. A lot of people throw up empty ones so they don't get a bunch of 404s in their logs.
aaronjj is offline   Reply With Quote
Old Nov 25, 2007, 13:29   #8
aaronjj
SitePoint Addict
 
Join Date: Mar 2006
Posts: 380
Quote:
Originally Posted by holmescreek View Post
See my post above, and check out the link. It is about the clearest set of instructions on robots.txt files that I have found.
Your post is inaccurate. You can't block access crawling of a subdomain by putting instructions in a robots.txt file in the top domain's root.
aaronjj is offline   Reply With Quote
Old Nov 25, 2007, 14:06   #9
armchaircritic
8.12.13.18
SitePoint Award Recipient
 
armchaircritic's Avatar
 
Join Date: Nov 2006
Location: Silures
Posts: 2,723
Quote:
Originally Posted by holmescreek View Post
See my post above, and check out the link. It is about the clearest set of instructions on robots.txt files that I have found.
Ah! Missed that on first glance.. thanks, it should take some of the stress out of creating one -at first glance it looks very straightforward.
armchaircritic is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 18:08.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved