On Oct 31, 3:27 am, Vasile Ermicioi <elff...@gmail.com> wrote:
> a few steps that I use, I assume that you already installed web2py :)
> 0) set your domain at your registrar to point to webfaction dns servers
> 1) add your domain to webfaction domains
> 2) set your domain to be handled by your app (see webfaction's websites)
> 3 )create a routes.py (or rename routes_example.py) file with the content
>
> routes_in = (
> ('(.*):https?://(www\.)?yoursitename1\.com:(.*)/', '/yourapp1/'),
>         ('(.*):https?://(www\.)?yoursitename2\.com:(.*)/', '/yourapp2/'),
>  )
>
> def __routes_doctest():
>     pass
>
> if __name__ == '__main__':
>     import doctest
>     from gluon.rewrite import *
>     load(routes=__file__)
>     doctest.testmod()
>
> 4) restart your server (apache, nginx or whatever server you use)
>
> this kind of installation doesn't need multiple web2py's installations


Thanks for the hint. I managed to come up with a seemingly simpler
routes.py for same purpose.

routers = dict(
   BASE = dict(
        domains = {
            "my_domain.com" : "app1",
            "another_domain.com" : "app2",
            },
    ),
)

However, the only downside is only one said app is exposed to the said
domain. What if my domain need two apps to serve?

Regards,
Ray

Reply via email to