![]() |
Routes and other things.... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Routes and other things.... (/showthread.php?tid=43401) |
Routes and other things.... - El Forum - 07-10-2011 [eluser]bronet[/eluser] Hi, I'm working on a tvshow manager app and I do have some questions. I want to have urls like this: Quote:TVShow Info: http://localhost/show/1-white-collar/ And I use these rules in routes.php Code: $route['show/(:num)-(:any)/season-(:num)/ep-(:num)-(:any)'] = "manager/index/$1/$2/$3/$4/$5"; But.. when I acces: http://localhost/show/1-white-collar/hjhfjdhfh I receive something like this from $this->uri->rsegment_array(); (instead of 404 error) Code: Array ( [1] => manager [2] => index [3] => 1 [4] => white-collar [5] => hjhfjdhfh ) Or.. when I access: http://localhost/show/1-white-collar/season-dgfgfg/ I receive this: (instead of 404 error) Code: Array ( [1] => manager [2] => index [3] => 1 [4] => white-collar [5] => season-dgfgfg ) What can be wrong in my routes rules ? Routes and other things.... - El Forum - 07-10-2011 [eluser]John_Betong_002[/eluser] Try this: ./application/config/routes.php Code: $route["show"] = "manager"; // ./application.controllers/Manger.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); No doubt there may be better ways but at least this will get you started ![]() |