Answer the question
In order to leave comments, you need to log in
How to correctly create a rule for filter variables in urlrewrite.php 1C Bitrix?
Good afternoon,
using urlrewrite.php in 1C Bitrix, I'm trying to set up the CNC for filter parameters, now the url
looks
like
: balkon_da/ploshad_ot_0_do_12/esheget/get2/get3/...
There can be n number of these variables passed from the filter form.
Is it possible to write a condition that will receive values for variables depending on their presence in the url?
Do not carry a huge tail of all possible parameters:
array(
"CONDITION" => "#^/filter/tip_([a-zA-Z0-9\\-\\_]+)/etag_([a-zA-Z0-9\\-\\_]+)/balkon_([a-zA-Z0-9\\-\\_]+)\\?*(.*?)$#", // ...итд
"RULE" => "type=\$1&etag=\$2&balkon=/$3", // ..итд
"ID" => "",
"PATH" => "/filter/index.php",
),
Answer the question
In order to leave comments, you need to log in
the goal is to get the form
?tip_prodaga/etag_2/balkon_da/ploshad_ot_0_do_12/esheget/get2/get3/...
Try like this
Array(
"CONDITION" => "#^/filter/tip_([a-zA-Z0-9-_]+)/etag_([a-zA-Z0-9-_]+)/balkon_([a-zA-Z0-9-_]+)#", // ...итд
"RULE" => "type=\$1&etag=\$2&balkon=\$3", // ...итд
"ID" => "bitrix:catalog.smart.filter",
"PATH" => "/filter/index.php",
),
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question