Welcome Guest, Not a member yet? Register   Sign In
How to create custom Error 404 page
#2

(This post was last modified: 02-02-2020, 05:30 PM by littlej.)

Hello Falko !

You can set a custom 404 page in the "app/Config/Routes.php" file: https://codeigniter4.github.io/userguide...l#override

The part that will interest you is:
PHP Code:
// Would execute the show404 method of the App\Errors class
$routes->set404Override('App\Errors::show404'); 

So you just have to redirect to a Class::method of your choice, that will return the json response you are looking for :-)


> Maybe the RESTful madman will have something to add ? :-D
Reply


Messages In This Thread
How to create custom Error 404 page - by falko - 02-02-2020, 04:16 PM
RE: How to create custom Error 404 page - by littlej - 02-02-2020, 05:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB