When your website is encountering an issue, it displays an error page to inform visitors of the problem. By default, they will see the error page set by your hosting provider. This can be customised easily in your cPanel, so you can personalise error messages.
In this guide, you’ll learn how to create custom error pages. And we’ll guide you through how to add .htaccess rule, in case your customised error pages do not show.
How to Create Custom Error Pages
Follow the steps below to create custom error pages.
|Access your Hosting Manager.
|Scroll down to Advanced tab, then click Error Pages option.
|Under Step 1 - Select Domain to Manage Error Pages, select the domain you would want to manage from the drop-down list. If you only have one domain name you can skip this part and proceed to the next step.
|Under Step 2 - Select Page, if the error message you want to customise is a common error page for websites. Check under the Common Error tab.
Or you can click the Show All HTTP Error Status Codes tab to see the complete list of error pages. Then, click the corresponding link to customise.
|You’ll be directed to an editor page. Enter custom page code (e.g. HTML) or insert tags if you want.
See table below for a brief description of available tags:
|Lists the previous URL
Visitor’s IP Address
|Lists IP address of visitor
|Shows URL you tried to access
|Shows server's name
|List of browser type of visitors
Redirect Status Code
|Display error message codes
|Click the Save button.
A confirmation message will appear that changes are saved. Click the Go Back button to continue customising other error pages.
You can also set up .htaccess rule if in case, your custom error pages do not show.
How to Setup .htaccess Rule
Before making any changes, make sure to save a backup copy of your files by following the steps in this linked guide.
If you are seeing Crazy Domainsdefault pages as your Error Pages, add a .htaccess rule. Follow the steps below.
- Access the File Manager.
- Click the public_html folder from the left menu panel.
- Select the domain name you wish to manage.
Click the .htaccess file, then select Code Editor option at the upper part of the page.
You may also right-click .htaccess, then select Code Edit.
Add the following code to your .htaccess file and change the error number to the ones you customise:
ErrorDocument 411 /411.shtml
ErrorDocument 412 /412.shtml
ErrorDocument 505 /505.shtml
You can use existing pages as your resulting page in case you don’t want visitors seeing error pages. Just change the code after the slash ( / ) on the code above. In the example below, your home page will display whenever there is 505 Error.
ErrorDocument 505 /index.html
- Click the Save Changes button.
Congratulations! You've just customised your error pages. Please let us know if you need any further assistance, or if you have any questions. We’d love to help!