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 interner Serverfehler 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
- Melden Sie sich bei CPanel an.
- Öffnen Sie die Werkzeuge Seite.
- Im Fortschrittlich Abschnitt, klicken Error Pages.
- Unter Schritt 1, select the domain you want to configure.
- Unter Schritt 2, click the error code you want to customize.
- Enter the HTML content for the error page.
- Use the available variables to insert dynamic information if required.
- Klicken Speichern.
[Screenshot-Platzhalter: 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
Zum Beispiel, 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.
- Melden Sie sich bei CPanel an.
- Öffnen Sie die Werkzeuge Seite.
- Im Dateien Abschnitt, klicken Dateimanager.
- Navigate to the domain’s
public_htmldirectory. - Delete the corresponding
errorcode.shtmlDatei.
[Screenshot-Platzhalter: 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 Landingpages
- Provide consistent behavior across domains hosted on Cloud-Server
- Maintain a professional experience for sites deployed on a Dedizierter Server