Skip to content

Instantly share code, notes, and snippets.

@ArtemSites
Created October 25, 2019 15:03
Show Gist options
  • Save ArtemSites/7795770826fab036ca74fce4e2b4a2c5 to your computer and use it in GitHub Desktop.
Save ArtemSites/7795770826fab036ca74fce4e2b4a2c5 to your computer and use it in GitHub Desktop.
Bitrix отдача 404.php при 404 ошибке.
AddEventHandler('main', 'OnEpilog', '_Check404Error', 1);
function _Check404Error(){
if (defined('ERROR_404') && ERROR_404 == 'Y') {
global $APPLICATION;
$APPLICATION->RestartBuffer();
include $_SERVER['DOCUMENT_ROOT'] . SITE_TEMPLATE_PATH . '/header.php';
include $_SERVER['DOCUMENT_ROOT'] . '/404.php';
include $_SERVER['DOCUMENT_ROOT'] . SITE_TEMPLATE_PATH . '/footer.php';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment