in routes.py

myapps = ['app'] # assuming your app is called "app"

routes_in = [
  ('/admin/$anything','/admin/$anything'), # do not break admin
]
for app in myapps: routes_in += [ # for everyone of my apps
  ('/%s/static/$anything' % app,'/%s/static/$anything' % app), # do
not break static  ('/%s/appadmin/$anything' % app,'/%s/appadmin/
$anything' % app), # do not break appadmin
  ('/%s/$anything' % app,'/%s/default/$anything' % app) # remove
"default"
]

routes_out = [(b,a) for (a,b) in routes_in] # reverse the mapping
On Nov 28, 3:47 am, lyn2py <[email protected]> wrote:
> I know routes.py has been brought up many times, but I haven't been
> able to get it to work for me.
>
> Here's what I want to do:
> I would like to remove "default" from the URL in>> localhost/app/default/index
>
> so that it appears as
>
> >> localhost/app/index
>
> I have referenced the posts in google groups and 
> athttp://web2py.com/book/default/chapter/04#URL-Rewrite
>
> I have reloaded routes in the admin before testing.
>
> Where should I put routes.py and what code should I put inside it to
> make this work?
>
> Thanks!

Reply via email to