From 49c3859a00e8a23aa2804e113a8bc042badcc41b Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 20 May 2011 20:59:35 -0400 Subject: [PATCH] dynamic robots.txt to refer to sitemap.xml --- app/views/sitemap/robots.text.erb | 2 ++ config/routes.rb | 1 + public/robots.txt | 5 ----- 3 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 app/views/sitemap/robots.text.erb delete mode 100644 public/robots.txt diff --git a/app/views/sitemap/robots.text.erb b/app/views/sitemap/robots.text.erb new file mode 100644 index 00000000..c65800ab --- /dev/null +++ b/app/views/sitemap/robots.text.erb @@ -0,0 +1,2 @@ +Sitemap: <%= sitemap_url %> + diff --git a/config/routes.rb b/config/routes.rb index b5ff9bd0..9416e110 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -43,5 +43,6 @@ OpenneoImpressItems::Application.routes.draw do |map| match '/terms' => 'static#terms', :as => :terms match '/sitemap.xml' => 'sitemap#index', :as => :sitemap, :format => :xml + match '/robots.txt' => 'sitemap#robots', :as => :robots, :format => :text end diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100644 index 085187fa..00000000 --- a/public/robots.txt +++ /dev/null @@ -1,5 +0,0 @@ -# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file -# -# To ban all spiders from the entire site uncomment the next two lines: -# User-Agent: * -# Disallow: /