Log in
Model

CurrentUrlRewritesRegenerator

Magento\CatalogUrlRewrite\Model\Product\CurrentUrlRewritesRegenerator

What it does

This class regenerates URL rewrites for products when their URLs change, preserving redirect history if configured.

It handles both regular product URLs and URLs within anchor categories, creating proper 301 redirects from old URLs to new ones.

Developers use this when products are moved between categories or when product URL keys are updated to maintain SEO value and prevent broken links.

Public Methods

  • generate()
  • generateAnchor()