<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();

require_once(__DIR__ . '/include/constants.php');
require_once(__DIR__ . '/include/helper.php');

if (file_exists(__DIR__ . '/include/redirects.php')) {
    require_once(__DIR__ . '/include/redirects.php');
}


AddEventHandler('main', 'OnEpilog', array('CMainHandlers', 'OnEpilogHandler'));

class CMainHandlers {

    public static function OnEpilogHandler()
    {
        global $APPLICATION;
        $CURRENT_PAGE = "https://";
        $CURRENT_PAGE .= $_SERVER["HTTP_HOST"];
        $CURRENT_PAGE .= parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
        $APPLICATION->SetPageProperty('canonical', $CURRENT_PAGE);
    }
}