问题
I have transferred a old webshop to prestashop. The products have the same ID´s.
The old link look like this: /shopexd.asp?id=2760&bc=no
And the new one like this.
/da/mover/2760-truma-mover-sr.html
Is it possible to redirect to the new product links? By modifying the .htaccess file ?
回答1:
I assume you are using apache as webserver.
Try something like that and add:
RewriteRule ^shopexd.asp?id=([0-9]+)&(.*)$ /product.php?id_product=$1 [QSA,L]
to your .htaccess file.
回答2:
This works if you updated from 1.2 to 1.6 as example:
RewriteCond %{QUERY_STRING} (^|&)?id_product=(\d+)(&|$)
RewriteRule ^product\.php$ /index.php?id_product=%2&controller=product [R=301,L]
来源:https://stackoverflow.com/questions/9955234/redirect-old-product-links-to-new-prestashop-product-links