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

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.

Jump to Post

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.