Hello. The site has a section "Portfolio", on it bitrix: news. The problem is that when you change the address bar section_code, the main page of the section is returned to me. For example, if the address is portfolio / doma, then I’m there where I need to be in the "home" section, but if the address is portfolio / dooomaaaaajhlkvjzxk, then I find myself on the main page of the portfolio section. It is necessary to give 404 page. Support for the CNC is enabled, the addresses of the pages in the component and the information block are the same, the checkboxes "Set status 404" and "Display special page" are. component settings

information block settings

UPD solved the problem by adding the following code in component.php

$sectionList = array(); $ibRes = CIBlockSection::GetList( Array("ID"=>"ASC"), Array('IBLOCK_ID'=>$arParams["IBLOCK_ID"], 'GLOBAL_ACTIVE'=>'Y'), true, Array("ID", "CODE") ); while($ar_result = $ibRes->GetNext()) { $sectionList["ID"][] = $ar_result['ID']; $sectionList["CODE"][] = $ar_result['CODE']; } if((isset($arVariables["SECTION_ID"]) && array_search($arVariables["SECTION_ID"], $sectionList["ID"]) === false) || (isset($arVariables["SECTION_CODE"]) && array_search($arVariables["SECTION_CODE"], $sectionList["CODE"]) === false)) { \Bitrix\Iblock\Component\Tools::process404( "" ,($arParams["SET_STATUS_404"] === "Y") ,($arParams["SET_STATUS_404"] === "Y") ,($arParams["SHOW_404"] === "Y") ,$arParams["FILE_404"] ); } 
  • "STRICT_SECTION_CHECK" => "Y" add a parameter like this. Should help without editing component.php - Oleksandr

0