2013-05-18 36 views
1

我正在努力使我的网站更加有效搜索引擎优化友好型我注意到,无论何时通过标记或其他页面(2,3,4等)访问产品时,它将它添加到URL中。Opencart:更改页面ID路径

例如:

www.domain.com/Guardian-Survival-kit/culinary-can-of-preparedness-seeds.html?page=2 

我想从路径

Opencart的1.5.4

任何帮助将不胜感激除去?page=2

回答

0

您可以手动编辑每个产品前控制器文件的代码(例如搜索页面等),也可以使用类似this modification的东西,这样可以使您的所有产品URL在整个安装过程中保持一致。举个例子,我认为你得到那些关闭的页面是在产品搜索页面,所以你会打开/catalog/controller/product/search.php

查找这个代码

'href'  => $this->url->link('product/product', $url . '&product_id=' . $result['product_id']) 

,并更改为

'href'  => $this->url->link('product/product', 'product_id=' . $result['product_id']) 

然后保存。尝试进行此更改之前,请务必为此文件进行备份。这将删除URL的所有其他参数,并且只需要产品URL