0
如何在产品网址的末尾添加扩展名'.html'。
-My当前产品链接:
www.mysite.com/productlink
-I想成为:
www.mysite.com/productlink.htmlOpencart 1.5x - 在产品网址的末尾添加'.html'
我编辑目录/控制器/通用/ seo_url。 PHP,产品网址现在有.html,但是当我点击一个链接,它说404没有找到。我需要做什么 ?
if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id') || ($data['route'] == 'news/article' && $key == 'news_id')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");
if ($query->num_rows) {
$url .= '/' . $query->row['keyword'] . '.html';
unset($data[$key]);
}
它的工作,但这种方法将把每个链接.html。我只需要在产品页面。原因是我会重拍一个网站,SEO人员希望所有链接都与旧网站相同,只有在产品页面最后是'.html'。 –
,如果你用'index.php?route = product/$ 1'替换'index.php?_route _ = $ 1' –