I'm trying to simplify this code to a fewer lines.
// Controller function routing
$route['news/popular'] = "news/popular";
$route['news/featured'] = "news/featured";
$route['news/latest'] = "news/latest";
$route['news/index/(:any)'] = "news/index/$1"; // points to a url slug of article
$route['news/(:any)'] = "news/index/$1"; // points to article without 'index' segment
To this:
$route['news/(:any)'] = "news/$1";
$route['news/(:any)'] = "news/index/$1";
$route['news/index/(:any)'] = "news/index/$1";
Not working at all. Are there any other methods for this? or should I stick to the long code?