A
A
Alexander2020-12-21 20:01:02
1C-Bitrix
Alexander, 2020-12-21 20:01:02

How to add a condition to the urlrewrite.php file in Bitrix?

Greetings!

The /items/ folder contains the catalog component.
I want that when I go to the /items/container/ address, the /items/index.php?type=container file is accessed (the ?type=container request will be processed in sections.php of the catalog template)
How to correctly write the rule in urlrewrite.php ?
In this case, the standard CNC should also work (url of the detailed element).
I do it this way - it does not work.

//уже было
6 => 
  array (
    'CONDITION' => '#^/items/#',
    'RULE' => '',
    'ID' => 'bitrix:catalog',
    'PATH' => '/items/index.php',
    'SORT' => 100,
  ),
//я добавляю
  7 => 
  array (
    'CONDITION' => '#^/items/container/#',
    'RULE' => 'type=container',
    'PATH' => '/items/index.php',
    'SORT' => 10,
  ),

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2020-12-21
@AlexeyCaTHaR

Swap the rules, your 6th rule "interrupts" the 7th

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question