I have a problem.
That gives different addresses
1/ rewrite_url sub {
my $ID = shift;
my $Title = shift;
my $cats = $DB->table('Links')->get_categories($ID);
my ($cat_id,$cat_full_name) = each %$cats;
my $cat_url = $DB->table('Category')->as_url($cat_full_name);
$Title =~ y/ \t\r\n?"'#/__/d;
return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/';
}
<a href="<%rewrite_url($ID,$Title)%>">Detail</a>
=>
http://www.mysite.com/areas/cities_L3/ 2/ get_detailed_url sub {
my $link_id = shift;
my $link_db = $DB->table('Links');
my $link = $link_db->select({ ID => $link_id })->fetchrow_hashref;
my ($cat_id, $cat_name) = each %{$link_db->get_categories ($link->{ID})};
$cat_name =~ tr/ \t\r\n?"'#/__/d;
$link->{Title} =~ tr/ \t\r\n?"'#/__/d;
return "$CFG->{build_root_url}/$cat_name/$link->{Title}" . "_L$link->{ID}/";
}
<a href="<%get_detailed_url($prev)%>">Previous Link</a>
<a href="<%get_detailed_url($next)%>">Next Link</a> =>
http://www.mysite.com/country/cities_L3/ ----------------
How to obtain the same address for 1 and 2 ?
No - 1/
http://www.mysite.com/areas/cities_L3/ No - 2/
http://www.mysite.com/country/cities_L3/ Yes -
http://www.mysite.com/country/areas/cities_L3/ I do not find
Thank you for your assistance
Michel