Created
October 25, 2019 15:03
-
-
Save ArtemSites/7795770826fab036ca74fce4e2b4a2c5 to your computer and use it in GitHub Desktop.
Bitrix отдача 404.php при 404 ошибке.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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