Web hosting
How do I configure error pages?
When a visitor of your webpage sees an error on his/her screen either because the page that he/she wants to visit doesn't exist ( error 404 (Not found) ) or because there is an error in the customization of his/her account ( error 500 (Internal server error) ), then the visitor actually sees the default error pages.
Most of the times, ordinary visitors cannot understand the content of these pages and that may cause confusion. Through cPanel, you may customize these pages and make them easier to be comprehended by your visitors. This procedure will be described in the rest of this article:
Creating a custom error page
To create your own (custom) error page follow these steps:
- Login in the cPanel
-
Click on the option Error Pages that you will find in the section Advanced of cPanel.
-
If you have several domains in cPanel, choose the one that you are interested in from the Managing menu:
-
You will see a list of the Common Error Codes, click on the one that you want to create custom error page for.
The available options are the following:
- 400 (Bad request)
- 401 (Authorization required)
- 403 (Forbidden)
- 404 (Not found)
- and 500 (Internal server error)
To edit more error codes, click on the Show All HTTP Error Status Codes tab. For this example needs, we select the 404 (Not found) page.
-
Afterward, you will be transferred in the webpage editing interface. You can enter the html code that you want or you can still make use of the default tags.
Next you may find a brief description of the available tags:
- Referring URL - Lists the URL from which you reached the page.
- Visitor's IP address - Lists the IP address of the page visitor
- Requested URL - Lists the URL of the page you are trying to access.
- Server Name - Lists the name of the server.
- Visitor's Browser - Lists the type of visitor's browser
- Redirect Status Code - Lists the error message code, such as 500, or 404 etc
- Click on the Save button to save your choices.
Configuring .htaccess file
-
Edit the .htaccess file for your site and insert rules for the dump files you have created. The .htaccess file can be found in the public_html folder of your hosting package. If it doesn't exist, you can create one from the file manager of cPanel.
You may form the file as this:
ErrorDocument 400 /400.shtml
ErrorDocument 401 /401.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtml - Save the .htaccess file and when someone causes the appearance of an error file in your account, then he will see your own "Custom Error Page".