URL structure changed after CMS update

前端 未结 2 1412
孤街浪徒
孤街浪徒 2021-01-26 11:31

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

2条回答
  •  庸人自扰
    2021-01-26 12:04

    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]

提交回复
热议问题