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]
Comments
Post new comment