hromtoster
@hromtoster
Я сижу с хрома в тостере

Вместо 404 ошибки 301 редирект?

Добрый день, вместо 404 ошибки и показа страницы, битрикс редиректит на уровень выше:
site/catalog/fdjksnfdksjnfkjsd -> site/catalog (301)
site/dkfmskld -> site (301)
site/contacts/randomstring2______ -> site/contacts (301)


в htaccess:
ErrorDocument 404 /404.php

в 404.php:
include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/urlrewrite.php');
CHTTP::SetStatus("404 Not Found");
@define("ERROR_404","Y");
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Страница не найдена");


init.php:
его не существует

urlrewrite.php (в корне):
URLREWRITE

<?
$arUrlRewrite = array(
	array(
		"CONDITION" => "#^/bitrix/services/ymarket/([\\w\\d\\-]+)?(/)?(([\\w\\d\\-]+)(/)?)?#",
		"RULE" => "REQUEST_OBJECT=\$1&METHOD=\$4",
		"ID" => "",
		"PATH" => "/bitrix/services/ymarket/index.php",
	),
	array(
		"CONDITION" => "#^/personal/history-of-orders/#",
		"RULE" => "",
		"ID" => "bitrix:sale.personal.order",
		"PATH" => "/personal/history-of-orders/index.php",
	),
	array(
		"CONDITION" => "#^/acrit.exportproplus/(.*)#",
		"RULE" => "path=\$1",
		"ID" => "",
		"PATH" => "/acrit.exportproplus/index.php",
	),
	array(
		"CONDITION" => "#^/bitrix/services/ymarket/#",
		"RULE" => "",
		"ID" => "",
		"PATH" => "/bitrix/services/ymarket/index.php",
	),
	array(
		"CONDITION" => "#^/acrit.exportpro/(.*)#",
		"RULE" => "path=\$1",
		"ID" => "",
		"PATH" => "/acrit.exportpro/index.php",
	),
	array(
		"CONDITION" => "#^/contacts/stores/#",
		"RULE" => "",
		"ID" => "bitrix:catalog.store",
		"PATH" => "/contacts/stores/index.php",
	),
	array(
		"CONDITION" => "#^/contacts/stores/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/contacts/stores/index.php",
	),
	array(
		"CONDITION" => "#^/personal/order/#",
		"RULE" => "",
		"ID" => "bitrix:sale.personal.order",
		"PATH" => "/personal/order/index.php",
	),
	array(
		"CONDITION" => "#^/info/articles/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/info/articles/index.php",
	),
	array(
		"CONDITION" => "#^/company/news/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/company/news/index.php",
	),
	array(
		"CONDITION" => "#^/info/article/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/info/article/index.php",
	),
	array(
		"CONDITION" => "#^/catalogtest/#",
		"RULE" => "",
		"ID" => "bitrix:catalog",
		"PATH" => "/catalogtest/index.php",
	),
	array(
		"CONDITION" => "#^/info/brands/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/info/brands/index.php",
	),
	array(
		"CONDITION" => "#^/info/brand/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/info/brand/index.php",
	),
	array(
		"CONDITION" => "#^/products/#",
		"RULE" => "",
		"ID" => "bitrix:catalog",
		"PATH" => "/products/index.php",
	),
	array(
		"CONDITION" => "#^/services/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/services/index.php",
	),
	array(
		"CONDITION" => "#^/support/#",
		"RULE" => "",
		"ID" => "altasib:support",
		"PATH" => "/support/index.php",
	),
	array(
		"CONDITION" => "#^/test-bx/#",
		"RULE" => "",
		"ID" => "bitrix:catalog",
		"PATH" => "/test-bx/index.php",
	),
	array(
		"CONDITION" => "#^/project/#",
		"RULE" => "",
		"ID" => "bitrix:catalog",
		"PATH" => "/project/index.php",
	),
	array(
		"CONDITION" => "#^/news/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/news/index.php",
	),
	array(
		"CONDITION" => "#^/sale/#",
		"RULE" => "",
		"ID" => "bitrix:news",
		"PATH" => "/sale/index.php",
	),
	array(
		"CONDITION" => "#^/#",
		"RULE" => "",
		"ID" => "bitrix:catalog",
		"PATH" => "/catalog/index.php",
	),
	array(
		"CONDITION" => "#^/#",
		"RULE" => "",
		"ID" => "bitrix:catalog",
		"PATH" => "/catalog_test1/index.php",
	),
);

?>



/bitrix/modules/main/include/urlrewrite.php:
Не существует

Куда смотреть?, подскажите пожалуйста
  • Вопрос задан
  • 535 просмотров
Пригласить эксперта
Ответы на вопрос 1
@isa3v
init.php
urlrewrite.php
смотреть скорее всего тут
UP:
array(
    "CONDITION" => "#^/#",
    "RULE" => "",
    "ID" => "bitrix:catalog",
    "PATH" => "/catalog/index.php",
  ),
  array(
    "CONDITION" => "#^/#",
    "RULE" => "",
    "ID" => "bitrix:catalog",
    "PATH" => "/catalog_test1/index.php",
  ),


Скорее всего на главной идут 2 компонента с чпу, в котором не требуются. Что создает правило которое возможно и вызывает ту страницу вместо 404
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы