my question is about seo,please any one tell me about blocking or hiding subdomains so google can not crawl the links of subdoamins

Recommended Answers

All 3 Replies

You can right the code at robots.txt disallow functions.

Use Apache rewrite logic to serve a different robots.txt on the development domain:

<IfModule mod_rewrite.c>
RewriteEngine on
# Redirect non-www to wwww
RewriteCond %{HTTP_HOST} !^www\blahblah.adc [NC]
RewriteRule ^(.*)$ http://www.blahblah.adc/$1 [R=301,L]
</IfModule>

And then create a separate robots-dev.txt:

User-agent: *
Disallow: /

This will block subdomains.

Use Apache rewrite logic to serve a different robots.txt on the development domain:

<IfModule mod_rewrite.c>
RewriteEngine on
# Redirect non-www to wwww
RewriteCond %{HTTP_HOST} !^www\blahblah.adc [NC]
RewriteRule ^(.*)$ http://www.blahblah.adc/$1 [R=301,L]
</IfModule>

And then create a separate robots-dev.txt:

User-agent: *
Disallow: /

This will block subdomains.

is it working? am also want to hide sub domains from google on my website.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.