Log in
Model

CanonicalUrlRewriteGenerator

Magento\CatalogUrlRewrite\Model\Product\CanonicalUrlRewriteGenerator

What it does

This class generates canonical URL rewrites for products without category associations in Magento 2.

Developers use it when creating standalone product URLs that redirect directly to the product page, typically during product save operations or URL rewrite regeneration.

It creates the base product URL structure that isn't tied to any specific category path.

Public Methods

  • generate()