Answer the question
In order to leave comments, you need to log in
How to make correct urlrewrite?
The goal is to do proper url processing by writing a regular expression in urlrewrite.php
Now implemented like this
$arUrlRewrite=array (
0 =>
array (
'CONDITION' => '#^/uslugi/([a-z-0-9_]+)/([a-zA-Z0-9\\.\\-_]+)/?.*#',
'RULE' => 'SECTION_CODE=$1&CODE=$2',
'ID' => '',
'PATH' => '/uslugi/detail.php',
'SORT' => 100,
),
1 =>
array (
'CONDITION' => '#^/uslugi/([a-zA-Z0-9\\.\\-_]+)/?.*#',
'RULE' => 'SECTION_CODE=$1',
'ID' => '',
'PATH' => '/uslugi/index.php',
'SORT' => 100,
),
);
'CONDITION' => '#^/uslugi/([a-zA-Z0-9\\.\\-_]+)/#,
'CONDITION' => '#^/uslugi/([a-zA-Z0-9\\.\\-_]+)/(?.*)#',
'RULE' => 'SECTION_CODE=$1$2',
Answer the question
In order to leave comments, you need to log in
from the point of view of the regular expression, special characters need to be escaped, in the second option, put a backslash before the question mark
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question