accounts with multiple users and routing...

I'm building an application where a person/group can make an account
and then create users within this account. The idear is to store al
the data with a :account_id so that users can only see the data which
belongs to their account.

Now I wanted to create the following url layout:

hxxp://hostname.tld/:account/:action/:id

So if Alice starts an account with the name "asdf" she would login on

hxxp://hostname.tld/asdf/login

(hxxp://hostname.tld would contain the signup page.)

My question: What would be the best way to realize this layout?