In that case, I’m almost out of ideas.
Try this:
look for the following code in manager/includes/document.parser.class.inc.php:
function sendErrorPage() {
// invoke OnPageNotFound event
$this->invokeEvent('OnPageNotFound');
// $this->sendRedirect($this->makeUrl($this->config['error_page'], '', '&refurl=' . urlencode($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'])), 1);
$this->sendForward($this->config['error_page'] ? $this->config['error_page'] : $this->config['site_start'], 'HTTP/1.0 404 Not Found');
exit();
}
function sendUnauthorizedPage() {
// invoke OnPageUnauthorized event
$_REQUEST['refurl'] = $this->documentIdentifier;
$this->invokeEvent('OnPageUnauthorized');
if ($this->config['unauthorized_page']) {
$unauthorizedPage= $this->config['unauthorized_page'];
} elseif ($this->config['error_page']) {
$unauthorizedPage= $this->config['error_page'];
} else {
$unauthorizedPage= $this->config['site_start'];
}
$this->sendForward($unauthorizedPage, 'HTTP/1.1 401 Unauthorized');
exit();
}
The first thing to try is to put the following lines at the beginning of each function to make sure the correct function is executing:
die("Page Not Found -- my message"); // as the first line of the sendErrorPage() function
die("Unauthorized Page -- my message"); // as the first line of the sendUnauthorizedPage() function.
If you get the right message ("Page Not Found -- my message") when trying to access a doc that doesn’t exist, remove those two lines and try switching the comment in the following lines so sendErrorPage() uses sendRedirect() instead of sendForward:
$this->sendRedirect($this->makeUrl($this->config['error_page'], '', '&refurl=' . urlencode($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'])), 1);
// $this->sendForward($this->config['error_page'] ? $this->config['error_page'] : $this->config['site_start'], 'HTTP/1.0 404 Not Found');