1. Locate the error pages
The error pages are located in the /templates/system folder. You will find a series of files such as error.php, error-404.php, and error-500.php.
1. Create a custom error page
To create a custom error page, you can copy one of the existing files and rename it with an appropriate name. For example, if you want to create a custom 404 error page, you can copy the error-404.php file and rename it as custom-404.php.
1. Edit the custom error page
After creating the custom error page, you can edit it as per your requirement. You can add your own text, images, and links to make it more user-friendly and informative.
1. Set the custom error page as default
To set the custom error page as default, you need to edit the .htaccess file in the root directory of your website. Add the following code to the file:
ErrorDocument 404 /custom-404.php
This code will redirect all the 404 errors to the custom-404.php file.
1. Test the custom error page
After setting the custom error page, it is essential to test it. Open a non-existing page on your website to check whether the custom error page is displayed or not. Also, test other error pages to make sure they are working correctly.