fisheye/module-url-rewrite-optimiser
最新稳定版本:1.1.0
Composer 安装命令:
composer require fisheye/module-url-rewrite-optimiser
包简介
A Magento module that stops URL rewrites with category paths being generated for products when 'Use Categories Path for Product URLs' setting is disabled in config.
README 文档
README
Overview
A Magento module that stops URL rewrites with category paths being generated for products when 'Use Categories Path for Product URLs' setting is disabled in config.
Features
- Stop needless URL rewrites for products that include category paths being created
- Only applies when 'Use Categories Path for Product URLs' setting is set to 'No'
Note: this extension will only prevent category path based URL rewrites from being created. Removing existing URL rewrites will need to be managed separately (though may be added in a future version).
Issue
To highlight the issue (and purpose of this module) see the 2 scenarios below
Without module enabled
- 'Joust Duffle Bag' product is in 2 categories ('Gear' and 'Bags')
- 4 product URL rewrite records are created for this product
- 1 for the direct product URL
- 3 for category path URLS (2 for the categories the product is associated to and also the root category...)
- Overall 580 product URL rewrite records are created (using Magento's default sample data of 189 visible products and 39 categories)
With module enabled
- 'Joust Duffle Bag' product now just has 1 URL rewrite record for the direct path
- Overall reduced to 189 product URL rewrite records (i.e. 1 per visible product)
- Scale that up to thousands of products, categories, websites and store views and the space saved in the
url_rewritetable could be huge!
Compatibility
- PHP 7.x
- Magento Open Source / Commerce Edition 2.1.x / 2.2.x (may work on older versions, but untested)
Installation
composer require fisheye/module-url-rewrite-optimiser
php bin/magento module:enable Fisheye_UrlRewriteOptimiser
php bin/magento setup:upgrade
Cleanup
If you installed this extension to prevent product rewrites with a category path being generated and you want to clean up your existing rewrites by removing them, run this query;
DELETE FROM url_rewrite WHERE is_autogenerated = 1 AND request_path LIKE '%/%' AND target_path LIKE '%/category/%' AND target_path LIKE '%/product/%' AND entity_type = 'product' AND metadata LIKE '%category_id%';
Contributing
Issues, forks and pull requests welcomed :)
fisheye/module-url-rewrite-optimiser 适用场景与选型建议
fisheye/module-url-rewrite-optimiser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 226.28k 次下载、GitHub Stars 达 58, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fisheye/module-url-rewrite-optimiser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fisheye/module-url-rewrite-optimiser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 226.28k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 59
- 点击次数: 36
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 未知

