Put following rules into your routes.py to get exactly what you
described:
routes_in = (
("/", "/myapp/default/index"),
("/([a-z0-9]+)/?", r"/myapp/default/\1"),
("/(.*)", r"/myapp/\1")
)
routes_out = (
("/myapp/default/index", "/"),
("/myapp/default/(.*)", "r/\1"),
("/myapp/(.*)", r"/\1")
)
Notice that this have some limitations. You can
use "/controller/function/arg1/arg2/arg3" for any controller including
the default one and it will be mapped
to "/myapp/controller/function/arg1/arg2/arg3". But if you use a 1
segment url e.g. ("/function") as a shortcut to the default
controller "/myapp/default/function" no parameters can follow.
Otherwise this "/function/arg1/arg2" will be mapped incorrectly
to "/myapp/function/arg1/arg2" instead
of "/myapp/default/function/arg1/arg2".
If you really need that to work, you need to follow the example given
by Jonathan and implicitly list the default functions in routes.py,
like this:
DEFAULTS = ["index", "about", "privacy", "api"]
("/(%s.*)" % "|".join(DEFAULTS), r"/myapp/default/\1") <-- second rule
in routes_in
("/myapp/default/(%s.*" % "|".join(DEFAULTS), r"/\1"), <-- second rule
in routes_out