Creating error pages
Last updated: Mar 06, 2024

Creating a custom 404 (page not found) page in Webigniter is very easy.

A 404 page is the page which is shown when a visitor tries to access a page which does not exist.

To create a custom 404 page, simply create a file 404.php in the Views/errors folder in your project, if the errors folder does not exist, you can create it. Now when a visitor triggers a 404 error, the 404.php file is shown.

Within this 404.php file, you can use the PHP variable: $requestedPage, this variable holds the URL the visitor is trying to access.

1