How to set a rule in UrlRewrite Bitrix?

Tell me how in the UrlRewrite file to make the following url shortening

Url
=======================================================
site.ru/catalog/category/product/
The website -> Page with component catalog -> Category -> Product
=======================================================

The task of the next.
1. When you log on to the page site.ru/catalog - everything is as it should open. (i.e. the Directory categories)
2. When navigating to the category url to a view site.ru/category/
3. When you click on item in the category the url was kind of site.ru/category/product/

That is when you click on a category or product url to a decrease of the paragraph catalog.

I will be very grateful! For earlier thanks!
June 26th 19 at 13:57
2 answers
June 26th 19 at 13:59
Solution
Resolved the issue thanks to the pickup and then at random.
"SEF_MODE" => "Y",
 "SEF_FOLDER" => "/",
 "SEF_URL_TEMPLATES" => array(
 "sections" => "catalog/",
 "section" => "#SECTION_CODE#/",
 "element" => "#SECTION_CODE#/#ELEMENT_CODE#/",
 "compare" => "compare.php?action=#ACTION_CODE#",
 "smart_filter" => "#SECTION_CODE#/filter/#SMART_FILTER_PATH#/apply/",
 ),


If someone is aware of the shortcomings of this method please report! Thank you all!
If you have site.ru/category = site.ru/#SECTION_CODE# make sure that site.ru/catalog and site.ru/category really are processed by the same component and not fly to 404 - Gretchen40 commented on June 26th 19 at 14:02
Yes, like all good works
site.ru/catalog - Displays a list of categories. and when you click on any category site.ru/any_category also work out fine.

Only now I understand you need to follow to avoid overlaps in the names of the categories and sections at the root - Oceane commented on June 26th 19 at 14:05
: Yes, right. Judging by your setup, a directory component now hung on a root folder, so the possible intersections. - Gretchen40 commented on June 26th 19 at 14:08
June 26th 19 at 14:01
In UrlRewrite is only the entry point into a complex component, and the formation of the NC links need to be configured in the component, not UrlRewrite.
https://dev.1c-bitrix.ru/learning/course/?COURSE_I...
That is coming back to my pies

From the docks I realized. when forming the url, you need to rule SEF_FOLDER=/catalog/ . But it is necessary for me when switching to a list of categories.

There are options to solve my problem? - Gretchen40 commented on June 26th 19 at 14:04
I think if I understood You correctly. you have to add in the array of input parameters the following piece
"SEF_URL_TEMPLATES" => Array(
 "sections" => "#PATH#",
 "section_edit" => "folder/edit/#SECTION_ID#/#ACTION#/",
 "element" => "element/view/#ELEMENT_ID#/",
 "element_edit" => "element/edit/#ACTION#/#ELEMENT_ID#/",
 "element_history" => "element/history/#ELEMENT_ID#/",
 "element_history_get" => "element/historyget/#ELEMENT_ID#/#ELEMENT_NAME#",
 "element_upload" => "element/upload/#SECTION_ID#/",
 "user_view" => "/company/personal/user/#USER_ID#/",
 "connector" => "connector/",
 "help" => "help",
 "search" => "search/"
 ),


But how to configure it that would have solved my problem what I can not understand.

Now my piece looks like this
"SEF_URL_TEMPLATES" => array(
 "sections" => "",
 "section" => "#SECTION_CODE#/",
 "element" => "#SECTION_CODE#/#ELEMENT_CODE#/",
 "compare" => "compare.php?action=#ACTION_CODE#",
 "smart_filter" => "#SECTION_CODE#/filter/#SMART_FILTER_PATH#/apply/",
 ),
- Oceane commented on June 26th 19 at 14:07

Find more questions by tags 1C-Bitrix