Good day
On the site it is necessary to add a subdirectory for each page depending on the city (for example, Euroset )
I’ve added the required subdirectory to the address bar, but now I’ll need to set up address processing so that for example if I turn to the site.ru/moskva/catalog/razdel/element page, the site.ru/moskva/catalog/razdel/element page site.ru/catalog/razdel/element (without a city ) and so on for all pages of the site
Added a rule to urlrewrite (first decided to make a directory)

 $arUrlRewrite = array( array( "CONDITION" => "#^([a-zA-Z0-9%\\;\\\$\\&\\*\\.\\/\\^\\:\\?\\_\\=\\-]+)\\/irk\\/products\\/([0-9]+)\\/([0-9]+)#", "RULE" => "/products/\$2/\$3", "ID" => "", "PATH" => "", ),); 

the CNC directory is configured as / # SECTION_ID # / # ELEMENT_ID # /, matches the condition, but for some reason it does not work

  • like the correct regexp regexr.com/3e4lj works out - Dmitry Kozlov
  • Yes, I checked its performance and generally wrote it through regex101.com , the question is why it does not work in urlrewrite? - Ivan Bubliy
  • and what url does not work? no variables come at all? - Dmitry Kozlov
  • I'm looking at my urlwright. Try not to escape the "/" in the address. / irk / products / (\ d +) / (\ d +) - Dmitry Kozlov
  • tried, did not help, does not work at all, no directory address - Ivan Bubliy

0