Welcome Guest, Not a member yet? Register   Sign In
problem in routes.php

$route['tv']               = 'Controller_tv';
$route['tv/(:any)/(:num)'] = 'Controller_tv/$1/$2';    // tv/[category = popular,toprated, etc]/[pagination]
$route['tv/(:num)']        = 'Controller_tv/view/$1';  // tv/[id_tv]

if I access http://localhost/tv and http://localhost/tv/[category]/[pagination] its return true.
but if I access http://localhost/tv/[id_tv] its return 404 Page Not Found.

I know $route['tv/(:any)/(:num)'] and $route['tv/(:num)'] is collision. how i can fix it but not changings ( tv ).

thanks before

Put $route['tv/(:num)'] route after $route['tv'] and before $route['tv/(:any)/(:num)']

Routes that have (:any) in them have to be the last route in the routes file
because it is a wild card route.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Your life would be much easier if you would name your controllers to be what you want them to be in a URL. Instead of Controller_TV.php just call it TV.php. That would eliminate the awkward and otherwise unnecessary $route['tv'] = 'Controller_tv';  It's in the controllers directory so it's pretty hard to confuse it with some other kind of class.

It does make sense to name models and views for easy recognition. You can probably guess what Events_m.php and events_v.php are, and how they are likely related to the controller Events.php

Just a friendly suggestion.

Theme © iAndrew 2016 - Forum software by © MyBB