URL structure changed after CMS update

孤街浪徒 提交于 2019-12-02 19:55:20

问题


I take in charge the update of an existing Prestashop 1.4.1.4 website. The url for a product was like:

url/product.php?id_product=1322

But when I update to the new version 1.6.0.6, it became like:

url/index.php?id_product=1372&controller=product&id_lang=2

When I type in the browser:

url/product.php?id_product=1322

It leads me to 404 page.

Your help is appreciated.


回答1:


product.php was deprecated in PrestaShop 1.5 and was removed in PrestaShop 1.6.

Download PrestaShop 1.5 and copy product.php to your PrestaShop root folder.




回答2:


add those lines on your .htaccess file

RewriteCond %{QUERY_STRING} ^id_product=([0-9]*)$ RewriteRule ^product.php$ index.php?id_product=%1&controller=product [L,R=301]

RewriteCond %{QUERY_STRING} ^id_category=([0-9]*)$ RewriteRule ^category.php$ index.php?id_category=%1&controller=category [L,R=301]

RewriteCond %{QUERY_STRING} ^id_cms=([0-9]*)$ RewriteRule ^cms.php$ index.php?id_cms=%1&controller=cms [L,R=301]

RewriteCond %{QUERY_STRING} ^id_manufacturer=([0-9])&p=([0-9])$ RewriteRule ^manufacturer.php$ index.php?id_manufacturer=%1&p=%1=&controller=manufacturer [L,R=301]



来源:https://stackoverflow.com/questions/24012022/url-structure-changed-after-cms-update

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