Home
/
Website Help
/
Stats and Errors
/
How to add custom error pages?

How to add custom error pages?

Using custom error pages is a relatively simple task. Most modern content management systems have their way of creating a custom error page or it can be achieved by adding a plugin that has this functionality. To use a custom error page, start with creating the desired page. It can be HTML, PHP, an image, or anything else that would suit your needs.

Once it’s done, you should also create a .htaccess file in the public_html directory containing the rewrite rules related to the error page:

For a custom 404 error page named not_found.html, add:

ErrorDocument 404 /not_found.html

For custom 500 error page named internal_server_error.html, add:

ErrorDocument 500 /internal_server_error.html

If you already have a .htaccess file, add the corresponding lines by editing the file through Site Tools > Site > File Manager or using an external text editor locally on your computer.

Note that some .htaccess rules may prevent the custom error pages from working. If your application needs additional .htaccess rules to function normally it is best to handle the custom error pages from the application itself via plugins.

Share This Article