Answer the question
In order to leave comments, you need to log in
Urlrewrite Bitrix. How to write a rule that excludes the character code of an element from a url?
An infoblock for cities has been launched. Those cities that are in the infoblock are available for selection.
Url when choosing a city is formed like /element_code/catalog/ but accordingly gives 404, how to redirect the request just to /catalog/ ? catalog is given as an example, there can be a great number of urls, but they will all start with element_code of the city.
Answer the question
In order to leave comments, you need to log in
If you really want to implement this (and if I understood you correctly), then you will need to do more than just that.
Step 1.
1) Create a page /catalog/index.php, display $_REQUEST on this page
2) Create a rule (taken from the example above, from the user Artyom Luchnikov )
array(
"CONDITION" => "#^/([a-zA-Z0-9_-]*)/catalog/.*#",
"RULE" => "city_code=\$1",
"PATH" => "/catalog/index.php",
)
Isn't it easier to do instead of domain.ru/ city_code / like this: city_code .domain.ru ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question