function goToPageError($iderror = DEFAULT_CODIGO_DE_ERROR, $out = OUT_HTML)
 {
     if ($out == OUT_HTML) {
         header("location:../404.php?i={$iderror}");
         exit;
     } else {
         $xErr = new cError($iderror);
         $xErr->init();
         $arrResponse = array("codigo" => $iderror, "message" => $xErr->getDescription());
         exit(json_encode($arrResponse));
     }
 }
<?php

/**
*	Archivo de redireccion en paginas
*	//
*/
include_once "core/core.deprecated.inc.php";
include_once "core/core.error.inc.php";
$id = isset($_GET["i"]) ? $_GET["i"] : DEFAULT_CODIGO_DE_ERROR;
$xErr = new cError($id);
$xErr->init();
?>
<html>
<head>
<title>S.A.F.E. OSMS</title>
<link href="css/global.css" rel="stylesheet" type="text/css">
</head>
<style>
    body {
	text-align: center;
	font-family: monospace;  }
.error {
  background: #f2dede;
  color: #b94a48;
  border-color: #b94a48;
  max-width: 400px;
  width: 50%;
  margin:0 auto;
  min-height: 400px;
  border-radius: 10px;
  border-style: solid;