How to add custom error pages

Error pages are displayed when a user enters a wrong or outdated URL or is not authorized to access a specific directory of your web space. cPanel allows you to customize these default error pages to better suit your website’s design and messaging.

PRODUCTS THAT MIGHT INTEREST YOU:

Benefit from the best server plans and related services, competitive prices, coupled with personalized attention to each client. Supported by top-notch technical assistance that remains consistently accessible to address all your inquiries.

Here’s how to do it:

  1. Log into your cPanel:
    Access your cPanel dashboard to begin customizing your error pages.
  2. Navigate to the Error Pages Menu:
    In the cPanel dashboard, go to the Advanced section and select Error Pages.
  1. Select the Domain and Error Code:
    • Use the Managing drop-down menu to choose the domain you want to customize the error pages for.
    • Click on the specific error code you want to change, such as 404 or 500.
    • If the error code is not listed under Edit Common Error Codes, switch to Show All HTTP Error Status Codes to find it.
  2. Edit the Error Page:
    • After selecting an error code, you will be taken to an HTML editor where you can customize the page.
    • Use the available tags to display relevant information such as the requested URL, server name, visitor’s browser, and redirect status code.
    • Ensure you Save your changes once you’re done editing.
  3. Locate the .shtml File:
    The customized error page will be saved as a .shtml file in the root directory of your website.
  1. Connect the .shtml File to Your Website:
    • To make the custom error page active, you need to add a rule to the .htaccess file in your website’s root directory.
    • If you cannot see the .htaccess file, enable the Show Hidden Files (dotfiles) option in the Settings menu.
    • If the file doesn’t exist, create a new one using the File option in the File Manager.
  2. Edit the .htaccess File:
    Right-click on the .htaccess file and select Edit.

Add the following rule, adjusting the error code and file name as needed:

ErrorDocument 500 /500.shtml

For example, for a 404 error page, the rule should be:

ErrorDocument 404 /404.shtml

That’s it! Your custom error page is now set up and will be displayed to users when they encounter errors on your site.

Conclusion

Customizing error pages on your website is an effective way to maintain a professional appearance and guide users back to the correct content when errors occur. By following these steps, you can easily create and implement personalized error pages using cPanel, ensuring a better user experience.

HAVE A QUESTION OR WANT TO GET A CUSTOM SOLUTION?

CONTACT SALES

FAQ

Custom error pages are web pages that replace default server error messages, giving you control over the design and content.

Log into cPanel, navigate to the Advanced section, and select the Error Pages menu.

Yes, you can choose the domain from the Managing drop-down menu before editing the error page.

You can use tags like Requested URL, Server name, Visitor’s browser, and Redirect Status Code.

They are saved as .shtml files in the root directory of your website.

Add a rule to the .htaccess file in your website’s root directory to connect the .shtml file.

Enable the Show Hidden Files option in File Manager or create a new .htaccess file.

The syntax is ErrorDocument [error code] /[filename].shtml, adjusting the error code and filename accordingly.

Yes, cPanel allows customization for various HTTP error codes, including 404, 500, and more.

Custom error pages provide a better user experience, maintain site branding, and can guide users back to the correct content.