---
title: 'Custom URL Rewrite'
url: 'https://info.srv.kowal.co/docs/magento/modules/customurlrewrite'
markdown: 'https://info.srv.kowal.co/docs/magento/modules/customurlrewrite.md'
lang: en
date: '2026-11-29'
description: 'See how Custom URL Rewrite checks for an existing .html path when a product is saved and tries numbered URL keys. Test a collision across store views.'
taxonomy:
  category:
    - docs
    - Magento
    - Modules
  tag:
    - catalog
    - seo
---

# Custom URL Rewrite

**Composer** `kowal/module-customurlrewrite` · **Version** 1.0.2

## Product page

[Custom URL Rewrite — kowal.co](https://kowal.co/customurlrewrite-automatic-url-conflict-resolution)

## Description

Before a product repository save, check whether the URL key followed by .html already exists as a request path. On a collision, try successive numbered keys.

## For whom

For administrators of catalogs using .html product URLs where similar product names can generate duplicate keys.

## Features

- Check before a ProductRepository save.
- Try suffixes -1, -2 and so on.
- Store the selected URL key on the product.

## Installation

From the Magento root, with Composer access to the Kowal package, run

```sh
composer require kowal/module-customurlrewrite
bin/magento module:enable Kowal_CustomUrlChecker
bin/magento setup:upgrade
bin/magento cache:clean
```

## Configuration

1. The module takes effect when enabled and has no separate configuration form.
2. Check your product URL suffix. Version 1.0.2 looks for an exact request path built from the key and a fixed .html suffix.
3. Before deployment, test resaving an existing product and saving in a second store view.

## Requirements / notes

The lookup does not filter by product or store view. An existing path for the same product or another store view can also trigger a numbered key.

## FAQ

**Why did the key change when I saved a product without renaming it?**

If the existing key followed by .html is already in the rewrite table, the module treats it as occupied. Compare the stored key and destination URL after each test save.

## Verify the installation

```sh
bin/magento module:status Kowal_CustomUrlChecker
```

In a staging catalog containing model.html, save another product with the key model. If model-1.html is free, check for the key model-1 and open its URL. Save the product again and record the resulting key.

---

## Navigation

- Parent: [Magento 2 Extensions](https://info.srv.kowal.co/docs/magento/modules.md)
- Previous: [Kowal Task](https://info.srv.kowal.co/docs/magento/modules/task.md)
- Next: [Delete Products via Queue](https://info.srv.kowal.co/docs/magento/modules/module-deleteproductsqueue.md)
