Disallow search engine access your sub-domain pages
Big problem with SEO one my previous article: There are maybe many URL for one page, that is so bad for SEO. To fix that problem, we should disallow search engines to access your sub-domain pages. How to do that?
Create file robots-subdomain.txt contains:
# This example keeps all robots out User-agent: * Disallow: /
Open your .htaccess file add these lines, when search engines request robots.txt from sub-domain, we redirect it to robots-subdomain.txt
RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your-domain\.com$ [NC] RewriteCond %{HTTP_HOST} ^(.+)\.your-domain\.com$ [NC]
Unsigned version
Comments
Beware
Beware of abusing robot.txt. May be you will lost some important ranking.
SEO Marketing Vietnam
Excellent
Thanks alot, that is what i am looking for
Thanks you
I would like to add that, if the site has htaccess.txt, it should be changed to .htaccess
Post new comment