I basically want either *http://localhost/shop *or* http://localhost/shop/shoes* to route to index() in shop.py. Is that possible?
File *shop.py*: def index: return dict() On Friday, November 7, 2014 6:46:36 PM UTC-8, Anthony wrote: > > It's not quite clear what you want. Is "shoes" a controller, and if so, > are you saying you don't want it to appear in the URL but instead want it > to be the default controller? If so, just set default_controller='shoes'. > > Anthony > > On Friday, November 7, 2014 8:09:48 PM UTC-5, Erik wrote: >> >> I'm using the* parameter based* system for routing. I have the following >> in my routes.py: >> >> routers = dict( >> BASE=dict( >> default_application='myapp', >> ) >> ) >> >> When I open http://127.0.0.1:8000/shop I see the same content as I would >> see in *http://127.0.0.1:8000/myapp/shop >> <http://127.0.0.1:8000/myapp/shop> *which is great since I don't want >> the app name to show in the URL. >> >> Now I'm trying to figure out how can I map something like >> *http://127.0.0.1:8000/shop/shoes >> <http://127.0.0.1:8000/shop/shoes>* to *http://127.0.0.1:8000/shop >> <http://127.0.0.1:8000/shop>*? *http://127.0.0.1:8000/shop/shoes >> <http://127.0.0.1:8000/shop/shoes>* should be in the URL but behind the >> scenes it should actually be pointing to just *http://127.0.0.1:8000/shop >> <http://127.0.0.1:8000/shop>*. >> >> Seems it's possible to do it using the *Pattern-based* approach, but >> when I do that way then I can't seem to hide the app name in the URL. >> >> Any ideas? Thanks in advance! >> >> >> >> -- 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.

