Removing robots.txt from public #757

Merged
merged 1 commit into from Oct 5, 2011

Conversation

Projects
None yet
2 participants
@jasonfox

jasonfox commented Oct 5, 2011

I recently ran into an issue where I was trying to dynamically serve robots.txt from Rails, i.e., map "/robots.txt", => "welcome#robots". The reason for this is that I want to serve one version of the file in staging and a different version of the file in production. So, I implemented this approach and removed the default Rails robots.txt from my application's public folder only to find that robots.txt was still being picked up from somewhere. I determined that the culprit was the rails_admin gem.

I've searched for a way to prevent the robots.txt file from being picked up without having to modify rails_admin but have come up short. Since the robots.txt file in the gem serves no purpose and since it is conflicting with Rails it doesn't seem that it would hurt to remove it. However, let me know if you disagree or if you know of a different way to resolve this issue.

Thanks,
Jason

Removing robots.txt from public as it seems to get picked up if you r…
…emove robots.txt from your Rails app which prevents you from being able to serve robots.txt using a Rails controller action

sferik added a commit that referenced this pull request Oct 5, 2011

Merge pull request #757 from jasonfox/rails-3.0
Removing robots.txt from public

@sferik sferik merged commit 1d1622a into sferik:rails-3.0 Oct 5, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment