Rails robots.txt folders

前端 未结 1 1272
离开以前
离开以前 2021-02-05 10:20

I\'m about to launch a Rails app and as the last task, I wan\'t to set the robots.txt file. I couldn\'t find information about how the paths should be written properly for a Rai

1条回答
  •  无人共我
    2021-02-05 10:47

    you have to put your robots.txt in /public folder

    and it will look like in below

    The following example "/robots.txt" file specifies that no robots should visit any URL starting with "/cyberworld/map/" or "/tmp/", or /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
    

    for more information please follow below links

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

    and

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

    0 讨论(0)
提交回复
热议问题