Creating a custom error page

Visitors to your web site see an error page whenever an error occurs. For example, if users enter an incorrect URL or are not authorized to access specific directories, they see an error page. Companies often customize error pages by branding them with a corporate image and a link to their home page.

Custom error pages are optional. An error page is always displayed, whether a custom error page exists or not. If an error page has not been customized, Apache displays a default error page.

To create or modify a custom error page, follow these steps:

  • Log in to cPanel.
  • In the ADVANCED section of the cPanel home screen, click Error Pages.
  • Under Step 1, select the domain you want to configure for error pages.
  • Under Step 2, click the error page that you want to customize.
  • Type the HTML that you want to use in the error page. You can use the links above the editor to insert variables into your code for dynamic content. For example, the following HTML code demonstrates how to use a variable in a custom error page:
    <h1>404 Not Found</h1>
    <p>The requested page, <!--#echo var="REQUEST_URI" -->, is not available.</p>
  • Click Save. cPanel saves the custom error page.

Deleting a custom error page

When you create a custom error page, cPanel creates a file with the filename format error_number.shtml in the document root of the domain. You can use the cPanel File Manager to delete this file. To do this, follow these steps:

  • Log in to cPanel.
  • In the FILES section of the cPanel home screen, click File Manager.
  • Locate the document root directory (public_html) of the domain where you created the custom error page.
  • Delete the related file for the error number. For example, if you created a custom error page for the 404 Not Found error, delete the 404.shtml file.
Was this answer helpful? 0 Users Found This Useful (0 Votes)