mahipal negi
mahipal negi

Reputation: 317

How to create custom 404 error page in cake 3?

I am working on cake 3 project.

I want to create custom 404 error page for all cake errors like missing controller, method, template or others errors.

I want to show custom 404 error page for these all errors, but I don't have a clue.

Please let me know how to do that.

Upvotes: 1

Views: 1867

Answers (3)

Ananthaselvam P
Ananthaselvam P

Reputation: 382

Two steps needed.

First step: You want to change the app.php debug mode, please check this below,

/**
* Debug Level:
*
* Production Mode:
* false: No error messages, errors, or warnings shown.
*
* Development Mode:
* true: Errors and warnings shown.
*/

Development mode : 'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN)

Production mode : 'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN)

Second Step:

Now you need to customize the 404 page design through the error folder src\Error\.

Upvotes: 0

Jason Joslin
Jason Joslin

Reputation: 1144

Just edit the existing .ctp files in /src/Template/Error directory of your app

Upvotes: 0

DeadKat
DeadKat

Reputation: 11

I think you should just create a 404.ctp file in the src\Error\ folder of your app

Upvotes: 0

Related Questions