On Feb 1, 2011, at 9:23 PM, Kenneth Lundström wrote: > > >> Also user1 must be able to point user1.mydomain.com to his own domain ( > >> custom domain feature) for the application interface. How can I achieve > >> this? > >> I'm not sure what you mean by that. > > I understod it like that a user should have the ability to in settings add a > custom domain (myowndomain.net) to point to user1.mydomain.com. Of course the > users takes care of DNS and things like that but how to get web2py to > understand that users own domain even should be used.
By the time web2py sees it, request.env.http_host will be either myowndomain.net or user1.mydomain.net, depending on how the external redirection goes. Assuming all this is going to the same application, the easiest thing to do would be to look at http_host in a model file (before the controller gets it) and maybe stash it somewhere else, like request.env.user_domain or the like, for the controller to use. It could be tacked on to request.vars, too, but I don't think there's any great point in doing that. This all depends on what you want to *do* with the domain name information, of course.

