I'd like to run a site and a dedicated url shortener on the same instance 
of web2py. These are two different apps (let's call them MainApp and Short) 
corresponding to two different domains (let's say, mainapp.com and 
short.me). I've managed to set up my routes.conf and routes.py file such 
that things seem to be routing properly. However, I'd like to be able to 
pass strings of numbers as arguments to the Short app's default/index 
function in this way: "short.me/[some number]"; I'm not quite sure how to 
set up the routes file to accomplish this. Can somebody suggest 
modifications to the routes files that would permit passing numerical 
arguments? Thanks.

routes.conf:

http://mainapp.com /MainApp/default
http://short.me/ /Short/default

routes.py:

routers = dict(
  BASE  = dict(
      domains = {
          'mainapp.com': 'MainApp',
          'short.me:':'Short',
      }
  ),
)

The Short app's default function looks like this:

def index():
    redirect(URL('default', 'redirect', scheme='http', host='mainapp.com', 
        vars = dict(id = request.args(0))))






-- 
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