Subdomain disallow search bots via robots.txt

可紊 提交于 2020-01-03 03:19:04

问题


I want to disallow search robots to access the entire domain including subdomains using Robots.txt and potentially .htaccess

I want to make sure that any new subdomains in future are blocked without having to create one in the root of subdomain every time.

Is this possible?


回答1:


If you want to block robots via robots.txt, you'll have to create one for each subdomain. I suggest a script that monitors your Zone File and then automatically creates one.

Another solution is to use HTTP Basic Auth. It'll block all bots from accessing the CNAMEs but it'll require users to enter a username and password.

Or you could use IP Tables to restrict access by IP range.

There are multiple solutions you can use to prevent robots from accessing your CNAMEs, and there are even more solutions to prevent search engines from adding your pages into their index.

It'll depend on whether who you want to let in (good bots, bad bots, users, etc.) that will determine what solutions you would use.



来源:https://stackoverflow.com/questions/8803319/subdomain-disallow-search-bots-via-robots-txt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!