Disallow all for all user agents except one user agent?

余生长醉 提交于 2020-01-07 08:08:24

问题


How to disallow all for all user agents except one user agent? For example disallow all for all user agent, but allow for Googlebot only?


回答1:


User-agent: *
Disallow: /

User-agent: google
Allow: /

This sample robots.txt tells crawlers that if they are not with google. then it is preferred they don't crawl your site. While google has been given the greenpass to crawl anything on the site.

This file should be stored at www.example.com/robots.txt.

Please read up on robots.txt



来源:https://stackoverflow.com/questions/33617859/disallow-all-for-all-user-agents-except-one-user-agent

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