I am creating a CMS based on CodeIgniter. It stores "views" and its data in a database and, if necessary, collects the necessary ones. As you might have guessed - I can’t create a physical controller and an appropriate view for each page.
I realized that the routes come in handy, since I would prefer not to use the controller visible in the URL. Poorly explained: I am looking for a way to reassign all requests that do not end on a physically existing controller to a user one without it appearing in the URL. This controller, of course, handle 404 errors, etc.
Bad: .com/handler/actual-view/)Good: (.com/actual-view/)(there is no actual view controller, or it will be shown instead)
I added a route 404_overridethat points to handler/. Now I'm looking for a way to find out the requested view (i.e., the .com/actual-viewactual view is what I'm looking for).
I tried
$route['404_override/(:any)'] = 'handler/$1';
and the like, which completely removes the 404 redefinition.
source
share