Stop google indexing subdomain
Asked Answered
L

1

8

I have subdomain "klient" for testing websites for our clients and I don't want that to be indexed. I have set in robots.txt (in root of our web) this:

User-agent: *
disallow: /subdom/klient/*

But I'm not sure, if it does really work, because I have now found testing site in google results...

Where could be problem or how could we stop google and other bots indexing this folder...?

Thank you

Loreanloredana answered 26/5, 2017 at 12:0 Comment(5)
Is it a subdomain or a subdirectory?Trantham
It is subdirectory, based in ./subdom/klient/ and with .htaccess, it is accessible like subdomain (klient.url.com)Loreanloredana
From Google's perspective it is a subdomain, not a subdirectory.Trantham
@JohnKugelman yeah you are right... So what is right solution to go?Loreanloredana
Possible duplicate of How robots.txt file should be properly written for subdomains?Tillich
H
17

You can do that by placing a robots.txt in the root directory of your subdomain.

So in your klient.example.com, place a robots.txt with the following content:

User-agent: *
Disallow: /

If you want to remove already indexed pages, create a new webconsole site with your subdomain and remove the indexed pages there.

Hydrotaxis answered 26/5, 2017 at 12:13 Comment(2)
And will this affect all folders in this subdomain? Because the structure is for every client like this: klient.3angle.cz/ourClient/Loreanloredana
yes, this will affect all folders in subdomain. so: klient.3angle.cz/ourClient/ klient.3angle.cz/ourClient2/ klient.3angle.cz/newClient/ And every other folder and subfolder in klient.3angle.cz will get affected.Hydrotaxis

© 2022 - 2024 — McMap. All rights reserved.