Hello.
Recently I had to setup web2py on a shared hosting. However that hosting has
wsgi support.
Also that was not a new site but rather an old site, ported to web2py
I didn't find any good documentation on how to setup web2py in this case so
had to google and experiment.

So,
1) The problem:
  1) I do not have any control over main apache config file. Only .htaccess
  2) Old site must continue to function until web2py's clone is developed
enough. web2py must function in parallel
2) Solution:
  1) put web2py into root site's folder. So that you can browse, download
source files and so on.
  2) put .htaccess into web2py's root folder. Here it's contents:
       SetHandler wsgi-script
       Options +ExecCGI
  3) put .htaccess into site's root folder. Here it's contents:
       RewriteEngine On
       RewriteRule ^((static|auth|admin|mycontroller1|mycontroller2).*)$
/web2py/wsgihandler.py/myappname/$1 [QSA,PT,L]


Done. Now old site works as it did before, but several folders (static,
auth, admin, my controllers) are redirected to web2py.
BTW, Massimo, it may be worth adding this .htaccess to web2py's default
distribution. Comment all lines out and put some comments (may be just
copypaste my ones).

Regards
Alexey.

Reply via email to