Opencart:更改页面ID路径

时间:2013-05-18 21:19:41

标签: opencart

我正在努力让我的网站更加 SEO友好我注意到每当我通过标签或不同的页面(2,3,4等)去产品时它将它添加到URL。

例如:

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

我想从路径

中删除?page=2

Opencart 1.5.4

非常感谢任何帮助。

1 个答案:

答案 0 :(得分: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