I have a case – for all product URLs, I need to remove numbers and dashes with a 301 redirect, for example: remove 1234- from /category/1234-product/.
Instead of 1234- there can be any numbers.
But at the same time, I don’t need to change the URL /0192-test/ in the root of the site. Here is a .htaccess mask rule that solves this problem:
RedirectMatch 301 ^/category/([0-9]+)-(.*)/$ /category/$2/