Magento seo优化——让产品链接唯一
在Magento后台会默认开启Use Categories Path for Product URLs。

这时候产品链接就会变成两个http://127.0.0.1/magentoyouhua/index.php/furniture/living-room/ottoman.html,http://127.0.0.1/magentoyouhua/index.php/ottoman.html。两个链接同时链向一个页面时,这样对seo是不好的。解决方法:
一、在后台关闭这个功能。
二、修改php文件去除分类url路径,因为在关闭这个功能后,一些插件还是会自带分类url路径。打开app/code/core/Mage/Catalog/Model/url.php
找到
1 2 3 4 5 6 7 8 9 10 11 12 13 | if (null === $parentPath) { $parentPath = $this->getResource()->getCategoryParentPath($category); } elseif ($parentPath == '/') { $parentPath= ''; } 修改成 //if (null === $parentPath) { //$parentPath = $this->getResource()->getCategoryParentPath($category); //} //elseif ($parentPath == '/') { $parentPath= ''; //} |
然后刷新下索引就可以了。
紫月蓝骋