Quantcast
Channel: ShoutMeLoud Forum - WordPress, SEO & Blogging - Latest posts
Viewing all articles
Browse latest Browse all 27141

Blocking a sub domain with robots?

$
0
0

@Hitesh_Bhasin

Suppose, your subdomain is book.example.com
and it is pointed to /public_html/book/ path

1st step:-

In the Top directory robots.txt file

add there one line

Disallow: /book/

2nd step:

In book folder, add a .htaccess file with below code.

<IfModule mod_headers.c> 
      Header set X-Robots-Tag "noindex, nofollow"
</IfModule>

Please note: It will set no-index and nofollow tag at entire subdomain (will reflect book dir because, .htaccess is there). Dropbox has implemented similar concept to protect user privacy.

How to test it, either it's working or not?

Go to Mozilla Firefox > Press F12 > Then, Browse your subdomain
Now - Go to Network Tab, Click on your sub-domain, verify the header set

All the best :slight_smile:


Viewing all articles
Browse latest Browse all 27141

Trending Articles