Created
October 25, 2019 15:03
-
-
Save ArtemSites/e3ed39e2330b725fb58d3d2279e089b3 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
//local/php_interface/init.php | |
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