Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/12/2012, 10:33
ylodis
 
Fecha de Ingreso: septiembre-2004
Ubicación: Andorra
Mensajes: 130
Antigüedad: 19 años, 7 meses
Puntos: 0
Redireccionar Error 404 a Index.php

Hola,

Quiero que si se intenta entrar en una página dentro de mi sitio que no existe se vaya al index. Tengo esto en el .httacess
Código:
ErrorDocument 404 /index.php
Pero el error 404 es interceptado por el sistema de gestión de errores de Joomla, creo que en el fichero ../templates/system/error.php y acaba saliendo la pantalla de error por defecto.

¿ Cómo puedo cambiar el fichero (listado abajo) para que deje pasar el error 404 y se haga lo que dice .httacess ?

Código:
<?php
/**
 * @package		Joomla.Site
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
if (!isset($this->error)) {
	$this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
	$this->debug = false;
}
//get language and direction
$doc = JFactory::getDocument();
$this->language = $doc->language;
$this->direction = $doc->direction;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
	<title><?php echo $this->error->getCode(); ?> - <?php echo $this->title; ?></title>
	<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error.css" type="text/css" />
	<?php if ($this->direction == 'rtl') : ?>
	<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error_rtl.css" type="text/css" />
	<?php endif; ?>
</head>
<body>