<?
if(count($arResult['ITEMS'])==0)
{
if (Bitrix\Main\Loader::includeModule("iblock")
{
Bitrix\Iblock\Component\Tools::process404(
'Соответсвующий текст'
,true
,true
,true
,'/404.php'
);
}
else
{
LocalRedirect('/404.php');
};
die();
}
?>
<?
$bHasPage = (isset($_GET['PAGEN_'.$arResult["NavNum"]]) && $_GET['PAGEN_'.$arResult["NavNum"]]);
if($bHasPage)
{
if($_GET['PAGEN_'.$arResult["NavNum"]] == 1 && !isset($_GET['q']))
{
LocalRedirect($arResult["sUrlPath"], false, "301 Moved permanently");
}
elseif($_GET['PAGEN_'.$arResult["NavNum"]] > $arResult["nEndPage"])
{
if (!defined("ERROR_404"))
{
define("ERROR_404", "Y");
\CHTTP::setStatus("404 Not Found");
}
}
}
?>