Colonel Serveur - Hébergement de serveur d'infrastructure

Informations de contact

Tic 96072377

[email protected]

Commencer

Custom error pages allow you to control what visitors see when an error occurs on your website. Instead of showing the default web server message, you can display a branded page with helpful information or navigation links.

This feature is available on cPanel hosting accounts and applies per domain.

How error pages work

An error page is shown when the server encounters a specific HTTP error. Common examples include:

  • 404 Not Found when a URL does not exist
  • 403 Forbidden when access to a directory or file is not allowed
  • 500 Internal Server Error when the server cannot process a request

If no custom page is defined, the web server automatically displays a default error page.

Creating or editing a custom error page

  1. Connectez-vous à cPanel.
  2. Ouvrez le Outils page.
  3. Dans le Avancé section, faire un clic Error Pages.
  4. Sous Étape 1, select the domain you want to configure.
  5. Sous Étape 2, click the error code you want to customize.
  6. Enter the HTML content for the error page.
  7. Use the available variables to insert dynamic information if required.
  8. Faire un clic Sauvegarder.

[Screenshot placeholder: Error Pages editor in cPanel]

The custom error page becomes active immediately for the selected domain.

Example of dynamic content

The following example shows how to display the requested URL on a 404 error page:

<h1>404 Not Found</h1>
<p>The requested page, <!--#echo var="REQUEST_URI" -->, could not be found.</p>

Dynamic variables help visitors understand what went wrong without exposing sensitive information.

Where custom error pages are stored

When a custom error page is saved, cPanel creates a file in the domain document root using the format:

  • errorcode.shtml

Par exemple, a custom 404 page is stored as 404.shtml inside the domain’s public_html directory.

Deleting a custom error page

To revert to the default server error page, delete the custom file.

  1. Connectez-vous à cPanel.
  2. Ouvrez le Outils page.
  3. Dans le Fichiers section, faire un clic File Manager.
  4. Navigate to the domain’s public_html directory.
  5. Delete the corresponding errorcode.shtml file.

[Screenshot placeholder: File Manager showing 404.shtml]

Once removed, the default error page is shown again.

Practical use cases

Custom error pages are often used to:

  • Guide users back to the main site or website builder landing pages
  • Provide consistent behavior across domains hosted on serveurs cloud
  • Maintain a professional experience for sites deployed on a dedicated server