How to Create Custom Error Pages in cPanel

Unless you have installed a Content Management System (e.g. WordPress) that is pre-installed with custom error pages, visitors reaching your website will get the default error pages if they access a non-existing page. This is very common with 404 – page not found errors.

Sometimes, you may need to edit these error pages to match the look and feel of your website. The procedure is quite simple if you have cPanel on your hosting account.

In this guide, we will show you how to customize these pages to provide useful information to your web visitors.

Prerequisites

  • A domain name e.g. www.example.com
  • Web hosting account that supports Cpanel
  • Cpanel username and password.

Special Note: cPanel is the most popular web panel around and is offered as a standard feature by most web hosting companies.

Step 1:
Login to your cPanel account

Login to your cPanel account by visiting the url ‘http://www.yoursite.com/cpanel’. Remember to replace ‘yoursite.com’ with the primary domain name associated with your hosting account. Then, enter your username and password to log in to Cpanel.

Step 2:
Locate Error Pages icon on the dashboard

On the search box, enter ‘error pages’ and click the icon that appears as shown below:

Step 3:
Edit error pages depending on your domain

On the next screen, you will see a list of all error pages and an option to select a domain name associated with each page. This feature allows you to create different error pages for each website. Just select your domain from the drop-down box and click any error page to edit it. For instance, you may edit the ‘404 (Not found)’ page as shown below:

On the next page, you will see a blank page that you can customize according to your needs. You can also insert tags including referring URL, visitors IP address, requested URL, server name, visitor’s browser and redirect status code.

You can take advantage of all these features to provide more information to your visitors. For instance, we can enter the text below to customize the 404 (not found) error page:

Sorry, we can see you came from <!--#echo var="HTTP_REFERER" --> <br>
and your IP address is <!--#echo var="REMOTE_ADDR" --><br>
Unfortunately, the URL you requested (<!--#echo var="REQUEST_URI" -->) <br>
was not found on our <!--#echo var="HTTP_HOST" -->. <br>
You may contact us at admin@example.com <br>
and include the error code <!--#echo var="REDIRECT_STATUS" --><br>
as the subject of your email and we will get back to you.<br>

Remember to make changes on the file by clicking ‘Save’ at the bottom of the screen.

With that in place, any visitors trying to visit a non-existing page will see our custom 404 error page as shown below;

You can customize any of the common error pages including:

  • 401 (Authorization required)
  • 403 (Forbidden)
  • 404 (Not found)
  • 500 (Internal server error)

Conclusion

That’s all when it comes to creating custom error pages for your websites. Remember you can repeat the same procedure for any additional domain hosted on the same account. Although, we showed you how to edit the error pages in plain text, you might need to include styling effects to make the error pages more beautiful and match them to the theme and colours of your website.

 

Check out the top 3 cPanel hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How to Delete Extra Database Tables After Uninstalling a WordPress Plugin

Not all the plugins come with an option to delete all the settings
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Edit WordPress's wp-config.php File Using cPanel

As I have mentioned earlier, this file is responsible for connecting your websit
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to deactivate all your WordPress plugins at once from cPanel

While handling a WordPress website, you may encounter with many common WordP
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Edit the CSS for your WordPress Site Using the cPanel Hosting Control Panel

As you know, the design of a WordPress website is controlled by
4 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top