Forums / Install & configuration / eZ upgrade - urlalias

eZ upgrade - urlalias

Author Message

Heiner Wurbs

Friday 22 January 2010 9:08:52 am

Hello community,

I have a question concerning upgrading and url_alias: the upgrade from 3.9.3 to 4.2 works fine and at the end I have the glorious new URLs, but the old urls are not working any more. Example:

"/company/about" is now "/Company/About"

If I enter the old one "/company/about", the content is displayed, even it is the old url.

But if the example looks like:

"/company/where_we_are" is now "/Company/About/Where-we-are"

the Module not found page is displayed.

Any hints or ideas?

Heiner

Heiner Wurbs

Sunday 24 January 2010 1:33:59 am

There are some options in the transform.ini.

BUT: I want to use the new URLs and only as a fallback the old ones. So I suppose, the urlalias_compat is not the right Groups in Transformation.

Or, if this is not possible, is there an extension or solution to manage these old urls? Because they are still in the database ...

Nicolas Pastorino

Monday 25 January 2010 10:09:45 am

Hi Heiner,

This is a good question, and i must confess i called on eZ Engineering's help on that. We'll come back to you when we have the answer!

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Heiner Wurbs

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 :(

Heiner Wurbs

Monday 25 January 2010 2:17:58 pm

append:

[SiteSettings] 
ErrorHandler=displayerror

and in error.ini.append.php

[ErrorSettings-kernel]
# 20 - Module not found
ErrorHandler[20]=redirect