Bobcares

How to Create Custom Error Pages in cPanel & WHM

PDF Header PDF Footer

Learn how to create custom error pages in cPanel. Our cPanel Support team is here to answer queries and concerns.

How to Create Custom Error Pages in cPanel & WHM

When users land on a broken or restricted part of a website, like a missing page (404), internal server error (500), or restricted access (403), they’re usually met with a generic error page provided by the web server. These default error messages are bland and can leave a poor impression on your visitors.

Custom error pages enhance the user experience by providing helpful information and maintaining the site’s branding, while also guiding users back to relevant content. Fortunately, if you’re using cPanel or WHM, setting up these custom pages is straightforward.

Today, we will walk through creating custom error pages for both cPanel users and WHM administrators.

How to Create Custom Error Pages in cPanel

To set up custom error pages for a website through cPanel, follow these steps:

  1. First, access the cPanel dashboard with the login credentials.
  2. Then, scroll down to the Advanced section and click on Error Pages.
  3. If the cPanel account hosts multiple domains, choose the relevant domain from the Managing dropdown menu.
  4. Now, we’ll see a list of common error codes:
    • 400 – Bad Request
    • 401 – Authorization Required
    • 403 – Forbidden
    • 404 – Not Found
    • 500 – Internal Server Error

    Click on the error code we want to customize. We will use the 404 Not Found status code for this example. If you’re still encountering issues even after setting a custom 404 page, you may want to troubleshoot deeper. Here’s a helpful resource on resolving the cPanel HTTP Error 404.

  5. Now, we will be taken to an editor where you can write HTML for the custom error page. Here are some of the available tags:

    How to Create Custom Error Pages in cPanel & WHM

    We can also insert dynamic tags to display helpful information.

  6. After crafting the message page, click Save.

We can go back and repeat this process for other error codes as needed.

You’ve now created a custom error page! You can go back and repeat this process for other error codes as needed, such as the 403 Forbidden error, which is another common issue on cPanel-based websites.

How to Create Global Custom Error Pages with WHM

If we manage a server via WHM (Web Host Manager), we can configure server-wide custom error pages. This is especially useful for hosting providers or those managing multiple sites.

  1. First, log in to WHM with the root credentials.
  2. Then, go to Server Configuration > Terminal to open the command-line interface.
  3. Now, run the following command:
    mkdir /usr/local/apache/errorpagesCopy Code

    This will create a folder to store the custom error pages.

  4. Now, go to Service Configuration > Apache Configuration.
  5. Click Include Editor.
  6. In the Pre VirtualHost Include section, select All Versions.
  7. Then, paste the following code in the Global Configuration field:
    
    Alias /errorfolder /usr/local/apache/errorpages/
    ErrorDocument 400 /errorfolder/400.shtml
    ErrorDocument 401 /errorfolder/401.shtml
    ErrorDocument 403 /errorfolder/403.shtml
    ErrorDocument 404 /errorfolder/404.shtml
    ErrorDocument 500 /errorfolder/500.shtml
    Copy Code
  8. Now, click Update to save the changes. For those customizing Apache behavior more extensively, it might be worth reviewing how Apache Handlers work in cPanel to better understand server-side control.
  9. To apply the new settings, restart the Apache service. To do this, go back to the Apache Configuration page and click Restart Apache.

Now, any HTML files placed in the `/usr/local/apache/errorpages/` directory will be used as custom error pages for all hosted websites.

Customizing your error page with branding and helpful links can also help maintain trust, especially when facing connectivity issues like the ERR_SSL_PROTOCOL_ERROR that may confuse users.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

Custom error pages are a small but powerful way to improve a website’s professionalism and user experience. They provide meaningful feedback to visitors, reduce bounce rates, and help maintain trust.

In brief, our Support Experts demonstrated how to create custom error pages in cPanel.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Get featured on the Bobcares blog and share your expertise with a global tech audience.

WRITE FOR US

GET UP TO 25% OFF

cPanel Support

Spend time on your business, not on your servers.

Managing a server is time consuming. Whether you are an expert or a newbie, that is time you could use to focus on your product or service. Leave your server management & end-user tech support to us, and use that time to focus on the growth and success of your business.

TALK TO US Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!