Rails robots.txt文件夹

Nik*_*iko 17 robots.txt ruby-on-rails

我即将发布一个Rails应用程序,作为最后一项任务,我不想设置robots.txt文件.我找不到有关如何为Rails应用程序正确编写路径的信息.

起始路径始终是Rails应用程序或app文件夹的根路径吗?那我怎么会不允许例如img文件夹?

我是否必须在应用程序文件夹中编写路径,或者在网站上查看路径的样子,例如http://example.com/admin

Raj*_*Das 29

你必须把你robots.txt/public文件夹

它看起来像在下面

以下示例"/robots.txt"文件指定任何机器人都不应访问以"/cyberworld/map/"or 开头的任何URL "/tmp/",或者/foo.html:

# 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
Run Code Online (Sandbox Code Playgroud)

欲了解更多信息,请点击以下链接

https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt

http://www.robotstxt.org/robotstxt.html