CodeIgniter Forums
Is 404_override useful? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Is 404_override useful? (/showthread.php?tid=61797)



Is 404_override useful? - kilishan - 05-18-2015

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.


RE: Is 404_override useful? - John_Betong - 05-19-2015

(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


RE: Is 404_override useful? - Avenirer - 05-19-2015

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.


RE: Is 404_override useful? - ivantcholakov - 05-19-2015

It is useful.
http://iridadesign.com/starter-public-edition-3/www/missing-page