I changed category urls on site. Old are like this:
www.example-name.com/category-name-exactly-same-keywords/
www.example-name.com/category-name-exactly-same-keywords/subcategory-name-exactly-same-keywords/
New URLs:
www.example-name.com/category-name/
www.example-name.com/category/subcategory-name/
I removed "-exactly-same-keywords" from category URLs.
In my .htaccess I have this:
# Category 301 redirection
RewriteRule ^-some-category-suffix(.*)$ $1 [L,R=301]
It is fine, if there is just one category level, it rewrite this:
www.example-name.com/category-name-exactly-same-keywords/
to:
www.example-name.com/category-name/
But, if there is more than one category level it removes only last
www.example-name.com/category-name-exactly-same-keywords/subcategory-name-exactly-same-keywords/
to:
www.example-name.com/category-exactly-same-keywords/subcategory-name/
------------------------------------------------------------------------------------------
How to rewrite (remove) all instances of "-exactly-same-keywords", if more than one in old URLs to new URLs without it?