My production routes.py has this in it: routers = dict(BASE=dict(domains={'www.domain1.com': 'app1', 'www.domain2.com': 'app2'}))
-Jim On Friday, June 14, 2019 at 1:47:22 PM UTC-5, Vlad wrote: > > let me be a bit more specific, as my problem is apparently in missing > something very basic: > > here is a quote from PythonAnywhere docs: "...for each additional domain > name, you need to set up another PythonAnywhere web app from the web tab. > This time though, you should choose "manual configuration". Then, go and > edit your WSGI file. You should make it into a copy of the WSGI file for > the first web2py application, so that both domains point at the same web2py > installation. Then the web2py routes.py should work." > > So this is perfect, and routes.py works indeed. However, it doesn't work > fully for the root domains: > > routes.py can only have only entry corresponding to "/", for example: > > routes_in = ( > ( '/' ,' /app1/cont1/func1'), > > ) > > This will take care of www.domain1.com . > > Now, if I want to point www.domain2.com to /app2/conf2/func2 - I have no > way to handle this (unless I am missing something very basic here). I would > at least need to specify something like this: > ( '/app2', '/app2/conf2/func2' ) which will take care of > www.domain2.com/app2 but the root www.domain2.com will still be > redirecting to /app1/cont1/func1, as per the only "/" entry in routes.py, > as "/" doesn't distinguish between domains. > > What am I missing? How can I handle this properly?? > > On Friday, June 14, 2019 at 2:23:21 PM UTC-4, Vlad wrote: >> >> I've had multiple apps in one web2py with no problems, of course, but >> only up to the point I've assigned different domains to different apps >> >> I am on PythonAnywhere, but presumably it's the same issue on any >> hosting. >> >> I am giving 2 cnames for 2 apps, and I pointed both cnames properly. BUT >> only one domain works for bare domain - i.e. for www.domain1.com . For >> the second name I always have to specify the full path - >> www.domain2.com//app/cont/func. >> >> I am obviously missing something, but here is why I have this problem: >> >> they all share one routes.py on the web2py root level. routes.py can only >> have one entry corresponding to "/" - I can point "/" to app1/cont1/func1. >> So, www.domain2.com can't be handled without a/c/f , because no matter >> what the domain is, the only proper entry for the bare domain name is "/" >> in routes.py. >> >> How to handle this properly, i.e. to specify routing for each domain root >> - without having the 2nd web2py installation? >> >> >> >> -- 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 web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/4e86e650-c228-496d-b0da-4eb0cb96ef45%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.