404.php:
<?
require $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.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("Ошибка: 404 - Страница не найдена");
?>
<div class="error-block">
<div class="error-block__title">Ошибка 404</div>
<div class="error-block__title--sm">Страница не найдена</div>
<div class="error-block__text"><a href="/">Перейти на главную</a> или в <a href="/uslugi/montazh/">список услуг</a></div>
</div>
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");
?>
.htaccess
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_php7.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine Off
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>
urlrewrite.php
<?php
$arUrlRewrite=array (
16 =>
array (
'CONDITION' => '#^([^/]+?)\\??(.*)#',
'RULE' => 'SECTION_CODE=$1&$2',
'ID' => 'bitrix:catalog.section',
'PATH' => '/index.php',
'SORT' => 100,
),
14 =>
array (
'CONDITION' => '#^/catalog/#',
'RULE' => '',
'ID' => 'bitrix:catalog',
'PATH' => '/catalog/index.php',
'SORT' => 100,
),
13 =>
array (
'CONDITION' => '#^/uslugi/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/uslugi/index.php',
'SORT' => 100,
),
15 =>
array (
'CONDITION' => '#^/brend/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/brend/index.php',
'SORT' => 100,
),
17 =>
array (
'CONDITION' => '#^\\??(.*)#',
'RULE' => '&$1',
'ID' => 'bitrix:catalog.section',
'PATH' => '/index.php',
'SORT' => 100,
),
1 =>
array (
'CONDITION' => '#^/rest/#',
'RULE' => '',
'ID' => NULL,
'PATH' => '/bitrix/services/rest/index.php',
'SORT' => 100,
),
12 =>
array (
'CONDITION' => '#^/news/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/news/index.php',
'SORT' => 100,
),
);