I'm looking at changing the products URLs' structure on a Prestashop (v1.5) website. This process is quite straight-forward and it can be done instantly through the corresponding admin panel.
The thing is, many of the products are indexed on Google (and other search engines too I'm guessing) so I'd like to 301-redirect the old links until the indexers update themselves with the new URLs. I'm guessing it's probably the safest way to handle the change: avoiding 404s and duplicates.
Since I have hundreds of products in this shop, I'm not looking to redirect them one by one, obviously. But then I don't really know how to manage the structure change properly within an htaccess file.
At the moment, I'm using the default Prestashop structure:
{category:/}{id}-{rewrite}{-:ean13}.html
Which produces the following links:
http://www.sitename.com/category/123456-product-name-0123456789123.html
I'm now looking at changing it to the following structure (which I think might be more efficient because you can find the same words on category and product names):
{rewrite}-{id}-{:ean13}
Which would produce this kind of link:
http://www.sitename.com/product-name-123456-0123456789123
But now I don't really know how to handle the change, if it can even be done easily?
And without any changes, the old links aren't automatically redirected to the new ones.