0

When change the "URL Key" and save the category then throw the below error.

This store Migrate Magento 1.9 to Magento 2.3.5-p1 and used multi store view.

Error:

The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value, or change the Request Path fields in all locations listed below:

- fitness-equipment/strength/kettlebells.html

- fitness-equipment/strength/dumbbells.html

- fitness-equipment/strongman/hammer.html

I have try below solution but not fixed the issue:

Solution 1)

    - Truncate the url_rewrite table. 
    - Generate category url via https://github.com/olegkoval/magento2-regenerate_url_rewrites module
    - use command for genrate the category url: php bin/magento ok:urlrewrites:regenerate --entity-type=category

Solution 2)

https://magento.stackexchange.com/questions/259845/migration-tool-causing-url-rewrite-duplicates-in-magento-2-leading-to-missing-ca

Solution 3)

- Install module for remove duplicate: https://github.com/cadencelabs/urldedup
    - Generate category url via https://github.com/olegkoval/magento2-regenerate_url_rewrites module
- use command for genrate the category url: php bin/magento ok:urlrewrites:regenerate --entity-type=category

Solution 4)

- When save edit "URL Key" and save the category then show the error list url.
- I have open that all error url in separate window and delete it.
- Then Generate category url via https://github.com/olegkoval/magento2-regenerate_url_rewrites module
- use command for genrate the category url: php bin/magento ok:urlrewrites:regenerate --entity-type=category

But still getting same error after implement above four solution. If any have idea about this critical issue then let me know.

Any help would be appreciated. Thanks! enter image description here

1 Answer 1

0

Try removing all url_path attribute values from the database, there likely is a duplicate there and they are not used any longer.

Look in eav_attribute table to find the url_path field's attribute_id for both categories (entity_type_id 3) and products (entity_type_id 4). I'll use X and Y for those since you really don't want to use some random values from the internet.

Once you have those, delete from the corresponding tables catalog_category_entity_varchar and catalog_product_entity_varchar:

delete from catalog_category_entity_varchar where attribute_id = X;
delete from catalog_product_entity_varchar where attribute_id = Y;

After this, try your url regeneration again, or re-saving your category with the url key you're looking to use.

1
  • Not able to find url_path please check. Mar 1, 2021 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.