M
M
Maxim Tkachev2022-03-20 15:15:05
1C-Bitrix
Maxim Tkachev, 2022-03-20 15:15:05

How to set up a rule in urlwright.php?

There are rules
143 =>
array(
'CONDITION' => '#^/customers/promo/#',
'RULE' => 'ELEMENT_CODE=$1',
'ID' => 'bitrix:news',
'PATH' => '/customers/promo/index.php',
'SORT' => 100,
),

144 =>
array(
'CONDITION' => '#^/customers/promo/([\\w-_])/filter/ ([\\w-_]+)#',
'RULE' => 'ELEMENT_CODE=$1&SECTION_CODE=$4',
'ID' => 'bitrix:news',
'PATH' => '/customers/promo/index.php',
'SORT' => 100,
)
which should handle the link

customers/promo/domashniy-bbq/filter/type_from_section-is-pivo/

as a result I get SECTION_CODE' => 'filter' 'ELEMENT_CODE' => 'domashniy-bbq/?SECTION_CODE=filter'.
how to remake to get
'SECTION_CODE' => 'type_from_section-is-pivo'
'ELEMENT_CODE' => 'domashniy-bbq'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Edward, 2022-03-20
@Drayde

CONDITION => "#^/customers/promo/(.*)/filter/(.*)/#";

RULE' => 'ELEMENT_CODE=$1&SECTION_CODE=$2';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question