Multiple robots.txt for subdomains in rails

Posted by Christopher on Stack Overflow See other posts from Stack Overflow or by Christopher
Published on 2010-05-01T04:27:10Z Indexed on 2010/05/01 4:37 UTC
Read the original article Hit count: 247

Filed under:
|
|

I have a site with multiple subdomains and I want the named subdomains robots.txt to be different from the www one.

I tried to use .htaccess, but the FastCGI doesn't look at it.

So, I was trying to set up routes, but it doesn't seem that you can't do a direct rewrite since every routes needs a controller:

map.connect '/robots.txt', :controller => ?, :path => '/robots.www.txt', :conditions => { :subdomain => 'www' }
map.connect '/robots.txt', :controller => ?,  :path => '/robots.club.txt'

What would be the best way to approach this problem?

(I am using the request_routing plugin for subdomains)

© Stack Overflow or respective owner

Related posts about ruby

Related posts about on