Welcome Guest, Not a member yet? Register   Sign In
Use different 404 page on front-end and back-end
#4

You can't have different 404 pages if you just call show_404() ... it's obviously the same function no matter what you do.

(09-28-2015, 04:35 AM)Martin7483 Wrote: I would set a 404_override controller and handle the front- and back end 404 in that controller.

I don't think you can set the 404_override dynamically because the uri segments are set in the Router. You would need to extend the core Router if you want a frontend_404 and an admin_404

Actually, it's quite the opposite ... 404_override may be a single value, but it points at what to look for in the current directory and then naturally falls back to the root one.

When you have application/controllers/Error404.php and application/controllers/admin/Error404.php, setting $route['404_override'] to 'Error404' will cause admin/Error404.php to be loaded if you visit /admin/non-existing-uri.

I do have to say this though - you shouldn't 404 based on whether items exist in a list or not. The list itself still exists, even if empty.
Reply


Messages In This Thread
RE: Use different 404 page on front-end and back-end - by Narf - 09-28-2015, 06:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB