If ALL your other domains only need ONE SAME "web2py app" named
mastro, you are lucky. You only need to rename "mastro" as "welcome"
or "init". Problem solved.
If, in my cases, different domain needs different web2py app to serve,
I use a naive trick. Here is my "web2py app" welcome/default.py 's
index():
Well, my simple
def index(): # serves as a springboard
if request.env.http_host.endswith('
site_alpha.com'):
redirect(URL(a='alpha',c='default',f='index'))
if request.env.http_host.endswith('
site_beta.com'):
redirect(URL(a='beta',c='default',f='index'))
...
You get the idea.
It is not perfect. End users see a long url, e.g.
http://www.site_alpha.com/alpha/default/index
Besides, if site alpha 's end user types in
http://www.site_ALPHA.com/BETA/default/index,
oops, he sees contents in site beta. I can live with that. How about
you?
It is possible to use web2py's builtin url rewriting feature, or
nginx's url rewrite feature, which should be faster by the way. But I
did not go that far yet. People who've been there please give some
light.
Regards,
Ray