Magento Enterprise URL从1.12-> 1.13.1重新编写,正在为产品的URL添加不必要的字符

magento.stackexchange https://magento.stackexchange.com/questions/14616

  •  16-10-2019
  •  | 
  •  

我们只是在将Magento EE从1.12升级到1.13.1,并且在迁移脚本自动生成的URL重写上遇到了一些snag。

我们运行3种不同的商店视图,大多数产品通过每种产品进行复制,例如:

  • www.storename.com/mens/product.html
  • www.storename.com.au/mens/product.html
  • www.storename.co.uk/mens/product.html

但是,在运行URL迁移脚本后,所有这些URL都已经在前端打开,现在显示为:

  • www.storename.com/mens/product-1.html
  • www.storename.com.au/mens/Product-2.html
  • www.storename.co.uk/mens/product-3.html

我敢肯定,这与系统识别为重复的系统有关,因此在每个相应的URL中添加-1,-2,-3。

解决此问题的最佳方法是什么?我们不能继续升级,因为这将导致SEO噩梦,因为所有URL都喜欢 /product.html 将301到 /product-1.html 等等。

有帮助吗?

解决方案 2

挖掘后,这解决了我们的问题:

DELETE url_table
FROM catalog_product_entity_url_key url_table
INNER JOIN catalog_product_entity_varchar old_url_table ON url_table.store_id = old_url_table.store_id
AND url_table.store_id <>0
AND old_url_table.store_id <>0
AND url_table.attribute_id = old_url_table.attribute_id
AND url_table.entity_id = old_url_table.entity_id;

然后在整个网站上重新运行recidex,将问题解决-1的-2等...信用额度为此,请访问此页面: http://www.code4business.de/update-magento-enterprise-edition-edition-13-0-2/#more-1144

其他提示

通常,当导入的URL键已经存在于URL重写中时,这通常会发生,从而导致末尾添加了整数。 URL键,从 _url_key 表被限制为唯一。在EE 1.13之前,您有时还会出于某种原因获得附加的实体ID。我还没有在EE 1.13上看到这种特殊的行为。

为了解决问题,您基本上需要使用以下一系列查询重置URL重写。

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `core_url_rewrite`;
TRUNCATE TABLE `enterprise_catalog_category_rewrite`;
TRUNCATE TABLE `enterprise_catalog_product_rewrite`;
TRUNCATE TABLE `enterprise_url_rewrite`;
TRUNCATE TABLE `enterprise_url_rewrite_category_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_product_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_redirect_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_redirect_rewrite`;
SET FOREIGN_KEY_CHECKS = 1;

我以前做过此操作,只要您没有自定义重写,它就没有影响其他任何事情。请注意,这将删除所有URL重写,包括系统(例如您提到的系统)和具有的自定义URL enterprise_url_rewrite.system = 0.

看到这个 问题 以及更多信息。

许可以下: CC-BY-SA归因
scroll top