Inconsistent CodeIgniter routes.php behaviour -
i'm using codeigniter's routes file remap short urls relevant controller functions.
oddly enough, urls remapped, while others don't, though syntax identical.
below routes.php file. remapping of info/web , info/rent works expected, while info/cell , info/hotel gets redirected 404 function.
any idea causing it?
$route['default_controller'] = "home"; $route['404_override'] = 'home/four_o_four'; $route['robots.txt'] = 'home/robots'; $route['info/cell'] = "articles/tags/cellphone"; $route['info/rent'] = "articles/tags/car-rental"; $route['info/web'] = "articles/tags/internet-abroad"; $route['info/hotel'] = "articles/tags/hotel"; $route['articles/tags/(:any)'] = "articles/articles_by_tags/$1"; $route['articles/destination/(:any)'] = "articles/articles_by_destination/$1"; $route['articles/(:any)'] = "articles/show_article/$1";
you re-routing 1 uri re-routed uri.
$route['info/cell'] = "articles/tags/cellphone"; $route['info/rent'] = "articles/tags/car-rental"; $route['info/web'] = "articles/tags/internet-abroad"; $route['info/hotel'] = "articles/tags/hotel"; $route['articles/tags/(:any)'] = "articles/articles_by_tags/$1"; you supposed route from uri to controller/method, not uri.
just route them directly each corresponding controller/method...
$route['info/cell'] = "articles/articles_by_tags/cellphone"; $route['info/rent'] = "articles/articles_by_tags/car-rental"; $route['info/web'] = "articles/articles_by_tags/internet-abroad"; $route['info/hotel'] = "articles/articles_by_tags/hotel"; $route['articles/tags/(:any)'] = "articles/articles_by_tags/$1";
Comments
Post a Comment