An error page displays to visitors when they try to access a web page that has a problem. Each type of problem has its own status code. For example,
404 is the code for “Not Found” and shows when the webserver can’t find the page requested.
By default, cPanel creates error pages for the most common errors for any domains on the account. These include:
- 400 – Bad Request – The server cannot handle the visitor’s request because it is corrupt or unable to understand it. 401 – Unauthorized – This status code means that the user cannot access the page without completing the authentication process. Typically this page is displayed to visitors who cannot complete the Password Protection of a web directory.
- 403 – Forbidden – Access to the requested web page by the visitor is forbidden. This can be caused by file or folder permissions or specific rules set in the .htaccess file. For example, “deny from IP address”.
- 404 – Not Found – The requested page cannot be found. A typical reason for this error code is a non-existent page or improperly rewritten(Mod Rewrite) – request.
- 500 – Internal Server Error – Something with the communication between your website and the Web Server went wrong. Typically this can be caused by – **incorrect permissions set for the files and folders of your website or if the website is producing some error when the Web Server is executing the website’s code.
This tutorial will show you how to edit the most common error pages or create new ones for any error type.
How to Customize Error Pages in cPanel
Customizing your cPanel Error pages is relatively simple. You can take advantage of the error page builder to insert snippets, such as Referring URL, Visitors IP, Server name, Browser, and more.
You can add or customize pages for any error code beginning with 4 or 5.
Under the Advanced Panel, click the Error Pages icon.
Select Domain to Manage Error Pages
You will need to choose the domain to manage the error pages by selecting it in the dropdown box under “Step 1 – Select Domain to Manage Error Pages”.
Choose Error Page to Edit
The next step is to click one of the error pages to edit. There are two tabs containing links to the pages:
- Edit Common Error Codes
- Show All HTTP Error Status Codes
For most webmasters, Error Pages for the common error codes should be sufficient. However, you may want to consider creating pages for the following codes:
502 - Bad gateway
503 - Service unavailable
504 - Gateway timeout
In this example, let’s alter the
404 - Not found error page. To do this, click on the relevant link under the “Edit Common Error Codes” tab.
The default error pages use code in the following format:
<!--#set var="code" value="404" --> <!--#set var="reason" value="Not Found" --> <!--#set var="msg" value="The server cannot find the requested page:" --> <!--#include virtual="cp_errordocument.shtml" -->
This injects variables or “Tags” for the error code, reason, and a message into a default template. This can be found at
You can alter or delete this code \ template. At the top of the page, you can click several variables to insert information about the error into your page, including:
Visitor's IP address
Redirect Status Code
You can use these, along with any custom HTML, to create a more informative error page.
For example, on
404 pages, you may wish to include links to other parts of your site or even a link to your search page. See the FAQs below for best practices on customizing your