|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#3 |
|
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: / No htaccess involved. Just a plain-text file named robots.txt |
|
|
|
|
|
#4 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2006
Posts: 27
|
Thanks!
I wonder why I was away for so long...you Sitepoint guys are so helpful ![]() |
|
|
|
|
|
#5 |
|
8.12.13.18
![]() ![]() 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. |
|
|
|
|
|
#6 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#7 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2006
Posts: 380
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2006
Posts: 380
|
Quote:
|
|
|
|
|
|
|
#9 | |
|
8.12.13.18
![]() ![]() Join Date: Nov 2006
Location: Silures
Posts: 2,723
|
Quote:
![]() |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 18:08.










Thanks for posting this thread, I learned something from it too. 


Linear Mode
