Welcome Guest, Not a member yet? Register   Sign In
temp fix for 404 issue
#1

[eluser]Media Gearhead[/eluser]
I have been seeing lots of people posting about having trouble using their 404_override on a method when the controller already exists.
I have seen many different solutions posted and each of them appeared to require the user to modify some core files to get it to work. I have come up with an alternative solution that would not require this. It includes only editing the routes file in the config.

Code:
$route['404_override'] = 'error404';

$route['post/search'] = 'post/search';
$route['post/view/(:any)'] = "post/view/$1";
$route['expert/(:any)'] = $route['404_override'];

It is not perfect but will reliably work. You need to set a route for every controller/method that you want and then set the (:any) to allow for the rest to 404 with the correct error controller.

I said it wasn't that clean but it does work. You just need to remember to setup the route for each controller and model.




Theme © iAndrew 2016 - Forum software by © MyBB