Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question