redirect old product links to new prestashop product links

流过昼夜 提交于 2019-12-11 23:24:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!