Armand du Plessis wrote:
I've got a requirement which requires my site to accept all subdomains
e.g. sub1.domain.com, sub2.domain.com, sub3.domain.com etc and handle
them accordingly. I'm currently investigating the options for dealing
The server would be running Apache and I believe i would be able to
rewrite it there but 1st prize if I can do it with routes.
I'm very new to Rails, loving every minute btw, but a bit stuck on
this so any pointers would really be appreciated.
You could either route all subdomains to your Rails application and let the application decide what to do based on the subdomain or you could do some apache rewrite magic like you suggest. Assuming subdomains of the form you mentioned above the subdomain can be extracted in the controller simply with "request.subdomains".