How to make 301 redirect in .htaccess c substitution part of the URL?

Trying to do a 301 redirect in .htaccess types:

https://example.ru/catalog/strana-gorod-{123}-{456}/
->
https://example.ru/strana/gorod/

Where:
{123} - a pre-defined set of characters (only pages containing {123} should redirect)
{456} is any set of characters

With the help of Google and examples can cut out of Url /catalog/, can cut {123}-{456}, but the rest of the Url how to convert I do not know. How to do it?
March 19th 20 at 08:37
1 answer
March 19th 20 at 08:39
Solution
RewriteRule ^catalog/(strana)-(gorod)-.*/$ /$1/$2/ [R=301,L]
It works! Thank you) - Harmony.Howe commented on March 19th 20 at 08:42

Find more questions by tags htaccess