A
A
Alexander2020-10-29 10:04:46
1C-Bitrix
Alexander, 2020-10-29 10:04:46

How to specify a rule for urlrewrite.php for a directory?

In the catalog section, the catalog complex component displays a catalog of products. There are three root sections in the product catalog:
Russian cuisine, Japanese cuisine and Italian cuisine

Each of the root sections has its own subsections,
for example:
Italian cuisine - pizza subsection Italian cuisine
- risotto

subsection
the name of the root partition?

For example, instead of /catalog/italia/ there would be the address /italia/,
respectively, the subsection /catalog/italia/pizza/ would be displayed as /italia/pizza/

Created a rule in the urlrewrite.php file so that when clicking on the link /italia/
there was a redirect to /catalog/italia/ but the rule does not work

Tell me how to correctly specify the rule in urlrewrite?

array (
    'CONDITION' => '#^/italia/#', 
    'RULE' => '#^/catalog/italia/#', // здесь необходимо будет указать другое правило
    'ID' => 'bitrix:catalog',
    'PATH' => '/catalog/index.php',
    'SORT' => 100,
  )


Or is it better to abandon such an idea and simply display products from different sections in different physical folders using the same complex catalog component?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question