Upon new hosting account activation the public_html directory contains the 401.shtml, 403.shtml, 404.shtml, 500.shtml files.
These are the most common error pages which the web server uses upon generating some of the 401, 403, 404, 500 status codes.
The .shtml files are ordinary HTML files containing SSI tags. These tags are processed by the web server and the result is embedded into the page before it is sent to the web browser.
Enabling .shtml files
If you would like a certain error message to use the respective .shtml file in the .htaccess file, located in the same directory, you need to place the respective directive. If you want the 404 message to load the /404.shtml file, located in the website directory, you need to use:
ErrorDocument 404 /404.shtml
The ErrorDocument directive points the web server to load the specified 404.shtml file in case of a 404 Not Found status code.
Editing Error Pages (.shtml)
System error messages might be directly edited through the File Manager’s editor or the Error Pages menu in cPanel.
After you select the domain you will see the most common error messages in the list below.
Besides the enlisted choices you can also edit messages for other status codes such as 408, 502, 503 and others.
To edit a message, click on it. A code editor will open as you will see the existing content of this system message.
It might contain an HTML code as well as the special system SSI tags used to generate dynamic data such as server name, request URL, visitor’s IP and others. E.g. 404.shtml contains:
<!DOCTYPE html> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> </p>The requested URL <!--#echo var="REQUEST_URI" --> was not found on this server.</p> </body></html>
<!–#echo var=”REQUEST_URI” –> is an SSI tag that will be replaced with the URL requested by the web client.
A few examples for SSI tags which might be included into an error message:
<!--#echo var="HTTP_REFERER" -->
<!--#echo var="REMOTE_ADDR" -->
<!--#echo var="REQUEST_URI" -->
<!--#echo var="HTTP_HOST" -->
<!--#echo var="HTTP_USER_AGENT" -->