How to Create Custom Error Pages
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.
Step 1. Log in to your cPanel.
Step 2. Scroll down to Advanced tab, then click Error Pages option.
Step 3. 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.
Step 4. 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.
Step 5. 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:
Referring URL | Lists the previous URL |
---|---|
Visitor’s IP Address | Lists IP address of visitor |
Requested URL | Shows URL you tried to access |
Server Name | Shows server's name |
Visitor's Browser | List of browser type of visitors |
Redirect Status Code | Display error message codes |
Step 6. 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 Domains default 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
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!