各种消息来源告诉我 http://www.anthonygalli.com/robots.txt 不存在。
我在 public/robots.txt 中有一个文件
User-agent: *
Allow: /
Sitemap: http://www.anthonygalli.com/sitemap.xml.gz
如何使路线正常工作,以便错误消失并且 Google 可以正确抓取该网站?
最佳答案
确保您的 config/environment/development.rb
中有以下行:
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
关于ruby-on-rails - 如何路由到robots.txt?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39487102/