Let's say that I have a controller named
pages
and there is a method
slug_on_the_fly
public function slug_on_the_fly($slug)
How would my route for this look like?
E.g. for blog controller it would be easy:
$route['blog/(:any)'] = 'pages/slug_on_the_fly/$1';
and then http://localhost/blog/name-of-the-article
works nice
However, what if I want to do it like without blog
so e.g.
http://localhost/name-of-the-article
or http://localhost/another-article-blablabla
How to do it and don't break another routes e.g. $route['friends'] = 'users';
or $route['about-us'] = 'pages/about_us';
?
Because if I do:
$route['(:any)'] = 'pages/slug_on_the_fly/$1';
It will probably ruin everything else or?