while($arSection = $rsSections->GetNext())
{
$arResult["SECTIONS"][] = array(
"ID" => $arSection["ID"],
"UF" => $arSection["UF_TITLE"],
"DEPTH_LEVEL" => $arSection["DEPTH_LEVEL"],
"~NAME" => $arSection["~NAME"],
"~SECTION_PAGE_URL" => $arSection["~SECTION_PAGE_URL"],
);
$arResult["ELEMENT_LINKS"][$arSection["ID"]] = array();
}
$aMenuLinksNew = array();
$menuIndex = 0;
$previousDepthLevel = 1;
foreach($arResult["SECTIONS"] as $arSection)
{
if ($menuIndex > 0)
$aMenuLinksNew[$menuIndex - 1][3]["IS_PARENT"] = $arSection["DEPTH_LEVEL"] > $previousDepthLevel;
$previousDepthLevel = $arSection["DEPTH_LEVEL"];
$arResult["ELEMENT_LINKS"][$arSection["ID"]][] = urldecode($arSection["~SECTION_PAGE_URL"]);
$aMenuLinksNew[$menuIndex++] = array(
htmlspecialcharsbx($arSection["~NAME"]),
$arSection["~SECTION_PAGE_URL"],
$arResult["ELEMENT_LINKS"][$arSection["ID"]],
array(
"FROM_IBLOCK" => true,
"UF" => $arSection["UF_TITLE"],
"IS_PARENT" => false,
"DEPTH_LEVEL" => $arSection["DEPTH_LEVEL"],
),
);
}
return $aMenuLinksNew;
RewriteEngine On
RewriteRule ^product/(.*)$ /product-category/product/$1 [NC,R=301,L]
RewriteEngine on
RewriteBase /
RewriteRule ^product/(.*)$ product-category/product/$1 [R=301]
грубо говоря
так лучше.