I'm presuming you want something like this... /error/message.php. Then the page can parse out the error code and supply the appropriate response (for 404, 403, 410, etc.).
To make this work you need to configure directives so the server can point to your custom error handling page, rather than Apache's.
Code:
.htaccess
ErrorDocument 403 /error/message.php?err=403
ErrorDocument 404 /error/message.php?err=404
Your SHTML page would have something similar to this (PHP) example:
PHP Code:
$theDocument = $_SERVER['HTTP_HOST'] . $_SERVER['REDIRECT_URL'];
$theError = isset($_REQUEST['err']) ? $_REQUEST['err'] : null;
$theError = intval($theError);
.
.
.
<p>The document<?php
echo ", <strong>$theDocument</strong>, ";
echo (($theError !== 403) ? "could not be found on the server" : "is forbidden") . ".";
?></p>