CodeIgniter Forums

Full Version: Is 404_override useful?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm really struggling to see valid use-cases for the 404_override setting in the router. Since it only applies if it's managed to match it to a route but the controller/method is missing - isn't that only good for during development since it basically tells you that you mis-mapped a route or have a bad controller/method name?

EDIT: Ok, after trying some more (and not just reading through the code and manual) it does work for people visiting pages that don't exist on the site. Silly me. Would still love to hear the ways you use it, though.

If you've found it useful - how do you use it? I'd love to get to know that function better.
(05-18-2015, 11:43 AM)kilishan Wrote: [ -> ]...
...
EDIT: Ok, after trying some more (and not just reading through the code and manual) it does work for people visiting pages that don't exist on the site. Silly me. Would still love to hear the ways you use it, though.  

If you've found it useful - how do you use it? I'd love to get to know that function better.

I have $route['404_override'] = "c_A__SEARCH_URL/index"; which parses the URI and finds the nearest match otherwise a modified 404.php page
I also use the override. In my CI application I have slugs for every content and with the override I can simply send the url to a controller that can look the slug in the database and serve the specific content.