Best way to re-route URLs to specific controllers

2 views
Skip to first unread message

Juan Delgado

unread,
Apr 4, 2010, 3:32:59 PM4/4/10
to haxig...@googlegroups.com
Hi there,

Wondering what's the preferred way to re-route URLs to specific
controllers. I'm porting my site to haxeigniter and basically want to
get rid of some content, but still handle requests. Let's say I want
to use the same controller for different URLs. Example:

site.com/projects/wadus
site.com/proyectos/wadus
site.com/proyectos/wadus/index.html

They all should go now through the same controller and method.

Shall I just create my own router implementing Router or is there
anything coded out of the box to do this kind of thing? Something such
as (pseudo-code):

'/proyectos/*' = controller > projects, method > wadus;
'/projects/*' = controller > projects, method > wadus;

Cheers,

Juan

--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

Andreas Söderlund

unread,
Apr 4, 2010, 3:44:32 PM4/4/10
to haxig...@googlegroups.com
Hello! The only router in the system is the very simple haxigniter.server.routing.DefaultRouter. I would like to expand it or make a more advanced class, but I haven't had the time lately. :) It should be quite simple to make a router like the one you mention if you use DefaultRouter as a starting point. Feel free to ask if you have any questions about the framework.

/Andreas




--
To unsubscribe, reply using "remove me" as the subject.

Juan Delgado

unread,
Apr 4, 2010, 3:53:24 PM4/4/10
to haxig...@googlegroups.com
Yeah, no biggie. Managed to get it working for my needs, but adding a
note to the wiki would be nice.

Cheers!

Juan

Reply all
Reply to author
Forward
0 new messages