Skip to content

Instantly share code, notes, and snippets.

View joaopfsilva's full-sized avatar
🏠
Coding from Amsterdam

João Silva joaopfsilva

🏠
Coding from Amsterdam
View GitHub Profile
@joaopfsilva
joaopfsilva / README.md
Created February 17, 2021 13:55 — forked from timcheadle/README.md
Make /robots.txt aware of the Rails environment

Make /robots.txt aware of the Rails environment

You probably don't want Google crawling your development staging app. Here's how to fix that.

$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt

Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.