Welcome Guest, Not a member yet? Register   Sign In
Routing before 404
#1

[eluser]Ben Knowles[/eluser]
In my application I allow users to have their own URI such as /~username. The controller I have set up for the user page is /users/index/username so they can use this or /~username. I currently have /~(.+) routed to this controller but I would prefer not to use the ~ character.

What I want to do is set up a route so any URI that hasn't been matched to a controller is routed to the user controller.

The only solution I've found so far is to extend the CI_Router class. I extended this class and modified the _validate_request function to load a controller instead of the show_404 function. This seems to work well enough, but is there a better way of doing this without having to extend the router class?

Thanks


Messages In This Thread
Routing before 404 - by El Forum - 06-07-2008, 07:30 AM
Routing before 404 - by El Forum - 06-07-2008, 12:59 PM
Routing before 404 - by El Forum - 06-08-2008, 02:27 AM
Routing before 404 - by El Forum - 06-08-2008, 02:31 AM
Routing before 404 - by El Forum - 06-08-2008, 02:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB