CodeIgniter Forums
URI Routing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: URI Routing (/showthread.php?tid=17671)



URI Routing - El Forum - 04-12-2009

[eluser]Unknown[/eluser]
I'm trying to get URI routing working to create friendlier URLS

There are 3 sections to the site - mainsite, dashboard and dashboard admin

I have the dashboard section working like so

Code:
// example.com/dashboard/events/view routes to /events/view
$route['^dashboard/(.+)$'] = "$1";

I'm trying to get the dashboard admin to route in a similar way but having problems, here is my code

Code:
// example.com/dashboard/admin/user/add routes to /admin_user/add
$route['^dashboard/admin/(.+)$'] = "admin_$1";

Any help appreciated

Thanks
Dave


URI Routing - El Forum - 04-12-2009

[eluser]Thorpe Obazee[/eluser]
You should probably put this
Code:
// example.com/dashboard/admin/user/add routes to /admin_user/add
$route['^dashboard/admin/(.+)$'] = "admin_$1";
before adding this below
Code:
// example.com/dashboard/events/view routes to /events/view
$route['^dashboard/(.+)$'] = "$1";

if that doesn't work, probably add more information for us to see.