Rails robots.txt文件夹
我即将发布一个Rails应用程序,作为最后一项任务,我不想设置robots.txt文件。 我找不到有关如何为Rails应用程序正确编写路径的信息。
起始路径始终是Rails应用程序或app文件夹的根路径吗? 那我怎么会不允许例如img文件夹?
我是否必须在app文件夹中查看路径,或者在网站上看路径的样子,例如http://example.com/admin ?
你必须将你的robots.txt
放在/public
文件夹中
它看起来像在下面
以下示例“/robots.txt”文件指定任何机器人都不应访问以"/cyberworld/map/"
或"/tmp/"
或/foo.html
开头的任何URL:
# robots.txt for http://www.example.com/ User-agent: * Disallow: /cyberworld/map/ # This is an infinite virtual URL space Disallow: /tmp/ # these will soon disappear Disallow: /foo.html
欲了解更多信息,请点击以下链接
https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt
和