Learn cPanel

Controlling your Web Hosting Account has never been that easy thanks to cPanel web Control Panel!

• Last Updated: 02/03/2020
• ( 6 minutes reading )

How to edit the Error Pages for your website in cPanel

Introduction

When a visitor accesses your website, the Web Server can return different errors triggered by the website or the web server itself. Take, for example, the case when a visitor accesses a non-existing page on your website. The Web Server will be unable to find that page so that it will return the infamous 404 error code to the visitor.

Depending on the triggered error, the code can be different. Here are some of the most common error codes sent by the Web Server:

  • 400 - Bad Request - The server is unable to handle the visitor's request because it is either corrupted or the server was unable to understand it. 
  • 401 - Unauthorized - This status code means that the page accessed by the visitor cannot be accessed without the authentication process being completed. Typically, this page is displayed to visitors who are unable to complete the Password Protection of a web directory.
  • 403 - Forbidden - The request by the visitor web page is forbidden for access. The reason for this error can be either related to file/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 in case the website is producing some error when the Web Server is executing the website's code. 

Every one of these status codes is displaying a different error page, including some, in most cases, insufficient information about the cause of the issue. To provide a more detailed explanation or to change the design of these pages, cPanel provides you with a feature called "Error Pages". Using this feature, you will be able to set a custom design and code for each of the error codes displayed by the Web Server. In the following lines of this tutorial, we will review the "Error Pages" feature of cPanel in detail.

 

Accessing the Error Pages feature in cPanel

To be able to access the "Error Pages" feature you will first have to access and log in to the cPanel service for your Web Hosting Account. Once logged in, you should see a complete list of all the features cPanel has to offer.

To find the "Error Pages" features, please either use the search tool provided at the top of the page or you can locate the "Advanced" features group, and under that group, you will find the "Error Pages" feature.

 

error-pages-functionality

 

Upon clicking on the "Error Pages" feature, cPanel will redirect you to the default page for the functionality where you will find a detailed explanation of what this feature is and also the tools you will need to edit the Error Pages for your websites. 

 

Editing the Error Pages for your websites

Now that you are in the right place let's review the process of editing an Error Page. You will see two sections or steps on the default page for the "Error Pages" feature as cPanel named those. 

  • In "Step 1 - Select Domain to Manage Error Pages", please select the domain/subdomain for which you would like to edit any of the Error Pages from the provided drop down menu in the cPanel functionality. 
  • In "Step 2 - Edit Error Pages for: <DOMAIN>" please use the tabs and links to select the error page you would like to edit.  

Basically, since the error pages have the same error codes regardless of the domain/subdomain, cPanel wants you to select a domain for which you will be editing the Error Pages. Once the domain is selected, you will have to pick an error code to edit the page for. 

 

select-domain-and-error-pagae

 

Once you click on a specific error code, please click on it so cPanel can redirect you to a brand new page with a code editor where you will be able to set the code for the error page you are editing. 

 

insert-tags

 

At the top of the page, you will notice that there are a few tags you can choose from. These tags are internal for cPanel, and you can use those to display different types of information:

  • Referring URL - Please use this tag when you would like to show your visitor what page they came from. 
  • Visitor's IP Address - Please use this tag when you would like to show the IP address of your visitor. 
  • Requested URL - Please use this tag when you would like to show the URL that your visitor requested. 
  • Server Name - Please use this tag when you would like to show the name of the server where your website is hosted. 
  • Visitor's Browser - Please use this tag when you would like to show the browser used by the visitor.
  • Redirect Status Code - Please Use this tag when you would like to show the status code for the redirect if such was performed. (301, 302)

Inserting a tag in the code of the Error Page is relatively simple - you just have to click on the chosen tag, and it will be inserted as a code in the code editor positioned right below these tags. 

When you are ready with the page edits, please scroll down to the bottom of the page and click on the "Save" button so the changes can be saved. 


save-error-age

 

Editing the code of the Error Pages will require some basic knowledge in HTML, CSS, and Javascript if you would like to achieve some advanced design or functionality. Still, thanks to cPanel, you can easily choose and edit the Error Pages in a convenient Web interface with very little knowledge of these web languages. In case you would need any assistance editing the pages or in case you are facing any difficulties doing so, please do not hesitate to contact our experienced Technical Support Crew since they will be more than glad to assist you with your request.

...
Nikola Zgurev
Technical Support Captain

Nikola is an accomplished tech-savvy extraordinaire with over six years of experience in the web hosting field. He started as a customer care representative and quickly rose the ranks to become a support supervisor and, eventually - the head of the technical department in HostArmada. His deep understanding of the client's needs, combined with his technical knowledge, makes him the perfect man to create the ideal harmony between client satisfaction and professional problem-solving. You will often find him creating helpful tutorials, articles, and blog posts that help existing customers get around.