Hi Massimo,

Would you recommend to setup anything on routes.py? I have the same
question of Carlos...
In my application all users will select a username and a subdomain will be
available
user1.example.com
user2.example.com

Every time that they use this URL it would go to a specific controller
function (default/mypage) using their usernames as arguments but now
showing off (it is not a redirect). Example:

user1.example.com would open default/mypage -> the personal page of this
user
user1.example.com/articles would open default/articles of this user
and so on, without lose the subdomain.

What is the recommended implementation? Use request.env.http_host or
routes.py? If it is routes could you provide a quick example?

Thanks in advance!

Tito




On Tue, Sep 3, 2013 at 7:56 AM, Massimo Di Pierro <
[email protected]> wrote:

> This is trivial. You just need a DNS entry for example.com and not for
> the specific domains (this is the default anyway). Than in web2py you read
> the entry from request.env.http_host
>
> If you use apache (you do not have to use apache) make sure you have a
> catch all virtual host <VirtualHost *.example.com:80>...</VirtualHost>.
>
>
> On Monday, 2 September 2013 16:08:02 UTC-5, Carlos Zenteno wrote:
>>
>> Has anybody done Dynamic Subdomains?
>>
>> What I mean:
>> I want each major user of my app to create a Dynamic subdomain when they
>> register, i.e.:
>>      cowboys.example.com
>>      steelers.example.com
>>      dolphins.example.com
>>
>> The user selects the subdomain when registering.
>>
>> I have read that in some frameworks they have to use Apache redirect
>> "magic",
>> and in other ones they use some kind of internal routing.
>>
>> I read the routing section in the book but did not get any clues of how
>> to do this.
>>
>> Any help and advice is greatly appreciated as usual...
>> Carlos\
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to