Monday 25 January 2010 2:09:32 pm
Hi Nicolas, that would be great! For now I made a hack of kernel/error/view.php: I replaced the line "$errorRedirectURL = $errorINI->variable( 'ErrorSettings', 'DefaultRedirectURL' );" with the following: $lost_uri = $_SERVER['REQUEST_URI'];
if ( strlen( $lost_uri ) > 0 and $lost_uri[0] == '/' )
$lost_uri = substr( $lost_uri, 1 );
$db = eZDB::instance();
$sql = "select * from ezurlalias where ";
$sql .= "source_url LIKE '". $lost_uri ."' ";
$lost_uri_rows = $db->arrayQuery( $sql, array( 'offset' => 0, 'limit' => $limit ) );
if ( count( $lost_uri_rows ) > 0) {
foreach ( $lost_uri_rows as $lost_uri_row )
{
$errorRedirectURL = $lost_uri_row['destination_url'];
}
eZDebug::writeError( "Hack: Found lost URI: " . $_SERVER['REQUEST_URI'] , "error/view.php" );
} else {
$errorRedirectURL = $errorINI->variable( 'ErrorSettings', 'DefaultRedirectURL' );
}
I suppose, that the solution could be in a transformation, but I dont understand it :(
|