your app real address:
localhost/init/default/user/rhys
where in request is
/<app>/<controller>/<function>/args[0]
And you want to pass:
<appname>/args[0]
So you can try it in your models/0.py
my_controllers = ['default', 'other']
my_functions = ['index', 'user', 'contact', 'show']
if not request.controller in my_controllers:
request.args[0] = str(request.controller) # you can also use deep_copy
here
request.controller = 'default'
if not request.function in my_functions:
request.functions = 'user'
On Fri, May 4, 2012 at 11:33 PM, Rhys <[email protected]> wrote:
> Hey Everyone,
>
> I'm trying to figure this one out, but can't seem to find the right way of
> doing it.
>
> Basically I want to be able to route incoming urls which have a persons
> username in the url to a default chosen controller. It's like how Facebook
> and Twitter do it. www.facebook.com/rhys.tague and you're redirected to
> your page.
>
> Is there a way to catch all urls which are not valid and then pass the url
> as a argument to the out going url?
>
> for instance
>
> example.com/rhys.tague
>
> example.com/init/default/user/rhys.tague
>
> I know you can do the catch all with anything or * but not to sure how to
> pass the variable.
>
> Cheers,
>
> Rhys
>
>
>
--
Bruno Rocha
[http://rochacbruno.com.br]