Answer the question
In order to leave comments, you need to log in
How to set up a 404 page in the directory component?
404 page does not work,
the CNC of the component is set as follows
"SEF_URL_TEMPLATES" => array(
"sections" => "",
"section" => "#SECTION_CODE#/",
"element" => "#SECTION_CODE#/#ELEMENT_CODE#/",
"compare" => "compare.php?action=#ACTION_CODE#",
"smart_filter" => "#SECTION_CODE#/filter/#SMART_FILTER_PATH#/apply/",
),
"SET_STATUS_404" => "Y",
"SET_TITLE" => "Y",
"SHOW_404" => "Y",
AddEventHandler('main', 'OnEpilog', '_Check404Error', 1);
function _Check404Error(){
if(defined('ERROR_404') && ERROR_404=='Y' || CHTTP::GetLastStatus() == "404 Not Found"){
GLOBAL $APPLICATION;
$APPLICATION->RestartBuffer();
$APPLICATION->SetPageProperty("keywords", "Страница не найдена");
$APPLICATION->SetPageProperty("title", "Страница не найдена");
$APPLICATION->SetPageProperty("description", "Страница не найдена");
$APPLICATION->SetPageProperty("ADDITIONAL_TITLE", "Страница не найдена");
require $_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/header.php';
require $_SERVER['DOCUMENT_ROOT'].'/404.php';
require $_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/footer.php';
}
}
Answer the question
In order to leave comments, you need to log in
Need to deal with CNC settings, do you have pure Nginx without apache?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question