A
A
Alexander Nameless082018-05-24 13:56:33
1C-Bitrix
Alexander Nameless08, 2018-05-24 13:56:33

How to solve the problem with url in bitrix?

Does anyone know how to deal with such a problem in Bitrix, pages open with an arbitrary set of characters at the end: teplo-gorod.ru/news/dtxnhjtjfrytk and so on in the "gallery", "news" and "articles" sections?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2018-05-24
@idruweb

see what you have specified in the infoblock settings and component settings

A
Anton, 2018-05-24
@Eridani

The response header is 404 not found, which means you need to set up a template for error output

V
Vladimir Skibin, 2018-05-24
@megafax

init.php

AddEventHandler('main', 'OnEpilog', '_Check404Error', 1);
 
function _Check404Error(){
  if (((defined('ERROR_404') && ERROR_404 == 'Y') || preg_match('~404~ius', CHTTP::GetLastStatus())) && !defined('ADMIN_SECTION')) {
    global $APPLICATION;
    $APPLICATION->RestartBuffer();
    $APPLICATION->AddChainItem("Ошибка 404");
    include $_SERVER['DOCUMENT_ROOT'] . SITE_TEMPLATE_PATH . '/header.php';
    include $_SERVER['DOCUMENT_ROOT'] . '/404.php';
    include $_SERVER['DOCUMENT_ROOT'] . SITE_TEMPLATE_PATH . '/footer.php';
  }
}

Code 404 gave up on you, then it's a matter of technology

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question