On Saturday, August 26, 2017 at 4:05:59 PM UTC-4, 98uj...@gmail.com wrote:
>
> How can I rewrite the URL (to drop asset):
>
> https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
> to look like:
>
> https://192.168.1.25:8000/stock/showcase/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1
> the app 'stock' ins't default
> the controllert 'showcase' isn't default
> the function 'asset' isn't default
>

Do you use another function as the default within the "showcase" 
controller? If not, you can define "asset" as the default function just for 
the "showcase" controller using the parameter-based router. Alternatively, 
you can use the default function to handle the above routes by checking for 
a URL arg and returning the appropriate response. For example, if the 
default function is "index":

def index():
    if not request.args:
        [code currently in the "index" function]
    else:
        [code currently in the "asset" function]

Finally, you could use the pattern-based rewrite system, though that can 
start to get complex.

Anthony

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to