P
P
Pavel Sidorov2020-01-31 15:33:41
PHP
Pavel Sidorov, 2020-01-31 15:33:41

How to write a regular expression for a directory in Bitrix?

Hello.

Friends tell me how to write a regular expression. I want

if the page is /catalog/ or /catalog/#SECTION_CODE#/ , then {
my layout
}
If the page is /catalog/#SECTION_CODE#/#ELEMENT_CODE#/ , then {
my other layout
}
If the page is main , or any other, then {
nothing
}

And tell me what to read so as not to be knock-knock. Don't judge =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KraydenSharp, 2020-01-31
@pavel__sidorov

Usually in bitrix I do such things on this page domain.ru/bitrix/admin/urlrewrite_list.php
For the directory, the rules should be something like this.

#^/catalog/([^/]+)/([^/]+)/#			/catalog/detail.php		ELEMENT_CODE=$2
#^/catalog/([^/]+)/#				/сatalog/section.php		SECTION_CODE=$1
#^/catalog/#					/сatalog/index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question