There are two ways to create a custom error page:
The easy way:
- Log in to your cPanel.
- At the bottom of your control panel under the Advanced section, click 'Error Pages'.
- From the drop-down menu, select the domain you want to create the custom error pages for.
- In 'Edit Common Error Codes', click the page you want to edit.
- Type in whatever you want the error page to say.
- Click save.
The professional way:
You can use custom error pages for any error as long as you know its number (like 404 for Page Not Found) by adding the following to your .htaccess file:
ErrorDocument errornumber /file.html
For example, if I had the file notfound.html in the root directory of my site and I wanted to use it for a 404 error I would use:
ErrorDocument 404 /notfound.html
If the file is not in the root directory of your site, you just need to put the path to it:
ErrorDocument 500 /errorpages/500.html
These are some of the most common errors:
401 - Authorization Required
400 - Bad request
403 - Forbidden
500 - Internal Server Error
404 - Wrong page