"ASC" ], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, ], false, [], [] ); $redirects = ""; while($car_search_ob = $car_search_res->GetNextElement()) { $car_existed = $car_search_ob->GetFields(); $car_existed['PROPERTIES'] = $car_search_ob->GetProperties(); $uid = $car_existed['PROPERTIES']['UID']['VALUE']; if(isset($old_uids[ $uid ])) { $old++; $redirects .= "RewriteRule ^car/". $old_uids[ $uid ] ."/$ https://www.evoleasing.ru/car/". $car_existed['CODE'] ."/ [R=301,NE,NC,L]\n"; } else { $new++; } $total++; } print "old "+$old."\n"; print "new "+$new."\n"; print "total "+$total."\n"; file_put_contents("./car_redirects.txt", $redirects); die(); ?>