What is the htaccess syntax to bulk redirect URL using variables?

Viewed 83

I am trying to use a generic rule to redirect old product url to new product url. Url looks like:

www.xyz.com/product1-oldname-xyz.html to www.xyz.com/product1-newname-xyz.html

So the URL stays the same except the bold part. Is there a generic solution with variables in htaccess to solve this?

I also found this mass-redirection solution but it is for a directory:

RedirectMatch ^/category/(.*)$ http://www.example.com/topic/$1
0 Answers
Related