Answer the question
In order to leave comments, you need to log in
How can I display another 404 error page in bitrix?
In init.php :
AddEventHandler("main","OnEpilog", "ShowError404");
function ShowError404() {
if (CHTTP::GetLastStatus()=='404 Not Found') {
global $APPLICATION;
$APPLICATION->RestartBuffer();
require $_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/header1.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
connect 404.php by analogy with the header and footer
require $_SERVER['DOCUMENT_ROOT'] .SITE_TEMPLATE_PATH. '/404.php';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question