Hello!
For some reason it does not work on the online catalog, sin on the CNC.
index file directory:
& lt;? Require ($ _ SERVER [ "DOCUMENT_ROOT"] "/ bitrix / header.php".);
global $ APPLICATION;
if ($ APPLICATION- & gt; GetCurDir () == "/ shop / catalog /")
{
// localRedirect ( '/ shop / catalog / section / vse /');
$ PageCur = $ APPLICATION- & gt; GetCurUri ();
$ PageNew = str_replace ( "/ shop / catalog /", "", $ pageCur);
//localRedirect('/shop/catalog/section/vse/'.$pageNew);
// echo $ pageNew;
}
? & gt;
& Lt;? $ APPLICATION- & gt; IncludeComponent (
"Bitrix: catalog",
"Main_custom",
Array (
"IBLOCK_TYPE" = & gt; "Catalog",
"IBLOCK_ID" = & gt; "7"
"SEF_MODE" = & gt; "Y",
"SEF_FOLDER" = & gt; "/ Shop / catalog /",
"SEF_URL_TEMPLATES" = & gt; Array (
"Sections" = & gt; "",
"Section" = & gt; "Section / # SECTION_CODE # /",
"Element" = & gt; "# ELEMENT_CODE # /",
"Compare" = & gt; "Compare.php? Action = # ACTION_CODE #",
"Smart_filter" = & gt; "# SECTION_CODE_PATH # / filter / # SMART_FILTER_PATH # / apply /",
),
),
false
);? & gt;
& Lt;? Require ($ _ SERVER [ "DOCUMENT_ROOT"] "/ bitrix / footer.php".);? & Gt;
Settings IB
urlrewrite:
& lt;? Php
$ ArUrlRewrite = array (
0 = & gt;
array (
'CONDITION' = & gt; '# ^ / Bitrix / services / ymarket / ([\\ w \\ d \\ -] +) (/) (([\\ w \\ d \\ -] +) (/)?)??? # '
'RULE' = & gt; 'REQUEST_OBJECT = $ 1 & amp; METHOD = $ 4'
'ID' = & gt; ''
'PATH' = & gt; '/Bitrix/services/ymarket/index.php',
'SORT' = & gt; 100,
),
1 = & gt;
array (
'CONDITION' = & gt; '# ^ / Personal / history-of-orders / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: sale.personal.order',
'PATH' = & gt; '/Personal/history-of-orders/index.php',
'SORT' = & gt; 100,
),
2 = & gt;
array (
'CONDITION' = & gt; '# ^ / Contacts / stores / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Contacts/stores/index.php',
'SORT' = & gt; 100,
),
3 = & gt;
array (
'CONDITION' = & gt; '# ^ / Contacts / stores / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: catalog.store',
'PATH' = & gt; '/Contacts/stores/index.php',
'SORT' = & gt; 100,
),
4 = & gt;
array (
'CONDITION' = & gt; '# ^ / Personal / order / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: sale.personal.order',
'PATH' = & gt; '/Personal/order/index.php',
'SORT' = & gt; 100,
),
5 = & gt;
array (
'CONDITION' = & gt; '# ^ / Info / articles / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Info/articles/index.php',
'SORT' = & gt; 100,
),
19 = & gt;
array (
'CONDITION' = & gt; '# ^ / Shop / catalog / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: catalog',
'PATH' = & gt; '/Shop/index.php',
'SORT' = & gt; 100,
),
7 = & gt;
array (
'CONDITION' = & gt; '# ^ / Info / article / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Info/article/index.php',
'SORT' = & gt; 100,
),
8 = & gt;
array (
'CONDITION' = & gt; '# ^ / Info / brands / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Info/brands/index.php',
'SORT' = & gt; 100,
),
9 = & gt;
array (
'CONDITION' = & gt; '# ^ / Info / brand / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Info/brand/index.php',
'SORT' = & gt; 100,
),
10 = & gt;
array (
'CONDITION' = & gt; '# ^ / Services / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Services/index.php',
'SORT' = & gt; 100,
),
11 = & gt;
array (
'CONDITION' = & gt; '# ^ / Products / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: catalog',
'PATH' = & gt; '/Products/index.php',
'SORT' = & gt; 100,
),
12 = & gt;
array (
'CONDITION' = & gt; '# ^ / Article / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: news',
'PATH' = & gt; '/Article/index.php',
'SORT' = & gt; 100,
),
13 = & gt;
array (
'CONDITION' = & gt; '# ^ / Catalog / #',
'RULE' = & gt; ''
'ID' = & gt; 'Bitrix: catalog',
'Path' = & gt; '/catalog/index.php',
'Sort' = & gt; 100,
),
14 = & gt;
Array (
'Condition' = & gt; '# ^ / blog / #',
'Rule' = & gt; ''
'Id' = & gt; 'Bitrix: Blog',
'Path' = & gt; '/blog/index.php',
'Sort' = & gt; 100,
),
15 = & gt;
Array (
'Condition' = & gt; '# ^ / sale / #',
'Rule' = & gt; ''
'Id' = & gt; 'Bitrix: News',
'Path' = & gt; '/sale/index.php',
'Sort' = & gt; 100,
),
16 = & gt;
Array (
'Condition' = & gt; '# ^ / news / #',
'Rule' = & gt; ''
'Id' = & gt; 'Bitrix: News',
'Path' = & gt; '/news/index.php',
'Sort' = & gt; 100,
),
18 = & gt;
Array (
'Condition' = & gt; '# ^ / Rest / #',
'Rule' = & gt; ''
'Id' = & gt; NULL
'Path' = & gt; '/Bitrix/Services/Rest/Index.php',
'Sort' = & gt; 100,
),
17 = & gt;
Array (
'Condition' = & gt; '# ^ / BUY / #',
'Rule' = & gt; ''
'Id' = & gt; 'Bitrix: News',
'Path' = & gt; '/buy/index.php',
'Sort' = & gt; 100,
),
);
Answer 1
First urlrewrite.php
19 = & gt;
Array (
'Condition' = & gt; '# ^ / Shop / Catalog / #',
'Rule' = & gt; ''
'Id' = & gt; 'Bitrix: Catalog',
'Path' = & gt; '/shop/index.php',
'Sort' = & gt; 100,
),
Here the Condition key points to / shop / catalog /
, and the executable file in /shop/index.php
? May correct will be like this:
19 = & gt;
Array (
'Condition' = & gt; '# ^ / Shop / Catalog / #',
'Rule' = & gt; ''
'Id' = & gt; 'Bitrix: Catalog',
'Path' = & gt; '/shop/catalog/index.php',
'Sort' = & gt; 100,
),
Next, the file itself /shop/catalog/index.php
in which you now have this:
$ application- & gt; includecomponent (
"Bitrix: Catalog",
"main_custom",
Array (
"Iblock_type" = & gt; "Catalog",
"Iblock_id" = & gt; "7",
"SEF_MODE" = & gt; "Y",
"SEF_FOLDER" = & gt; "/ SHOP / CATALOG /",
"SEF_URL_TEMPLATES" = & gt; Array (
"sections" = & gt; "",
"Section" = & gt; "Section / # send_code # /",
"Element" = & gt; "# Element_code # /",
"Compare" = & gt; "compare.php? action = # Action_code #",
"Smart_Filter" = & gt; "# Section_code_path # / filter / # Smart_Filter_path # / Apply /",
),
),
false
);
Ways exactly faithful and so you need?
It is more correct:
"sef_url_templates" = & gt; Array (
"sections" = & gt; "",
"Section" = & gt; "# Section_code # /", // or "# section_code_path # /",
"Element" = & gt; "#Section_code # / # element_code # /", // or "#SECCODE_PATH # / # element_code # /"
Answer 2
If the CNC does not work:
- Check that in the CNC settings in the info.
- Check the setting in the
- Check URLREWRITE.php
component
In UrLrewrite.php, there must be an entry and specify the actual file.
on CNC settings in component and info:
If you glue the “CNC CNC” and “section page” and from the component parameters, you must have a “section page section” from the information block parameters, only without macro # Site_Dir #. We have it there and here “/ Novosti / # saveion_code # /”, everything is right.