this be be of some help:
http://agilewebdevelopment.com/plugins/account_location
also, instead of parsing, try ActionController#subdomains:
Returns all the subdomains as an array, so ["dev", "www"]
would be
returned for "dev.www.rubyonrails.org". You can specify a different
tld_length, such as 2 to catch ["www"] instead of ["www",
"rubyonrails"] in "www.rubyonrails.co.uk".
ed
On 8/25/06, felix <felix.mccoey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> hi all, (not sure which is the official list anymore!)
>
> i have a cms that i am using for about 6 domains at the moment.
> i currently use svn to check out an ''instance'' of each
cms for a client
> and then modify a few global particular settings. each instance
> references its own database per client but in addition it accesses a
> global database that contains settings (such as if this client has
> access to shop functions etc).
>
> what i would like to do is use only one ''instance'' of the
cms and one
> database for all clients. i have given it some thought and these are
> the
> pros and cons:
>
> pros:
>
> + all clients get upgraded together
> + can release easily with capistrano to one location
> + don''t have separate rails processes running, can just have one
> cluster
> to control
>
> cons:
>
> - need to grab (and parse, for www.* and alternatives) the HTTP host
> header to use as a key for all transactions
> - issues with multiple domains and sending emails (envelope-from
> addresses)
> - an error with the application will effect all clients
> - (more i can''t think of)
>
> there are examples for doing this for sub domains but not for tlds. i
> think the first ''con'' above is going to be the main
performance killer
> but i would like to know if others think this is a silly idea or if it
> is feasible.
>
> any ideas and suggestions would be great.
>
> -felix
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---