Log in
Model

UrlRewrite

Magento\UrlRewrite\Model\UrlRewrite

What it does

This model class manages URL rewrites in Magento 2, handling the storage and manipulation of URL rewrite data including request paths, target paths, and redirect types.

Developers use this class when programmatically creating, updating, or deleting URL rewrites, such as for custom redirects or when managing SEO-friendly URLs.

It automatically handles cache invalidation for affected entities when URL rewrites are modified.

Public Methods

  • getMetadata()
  • setMetadata()
  • cleanEntitiesCache()
  • afterDelete()
  • afterSave()