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/errorpages

    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
  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 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!

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF