when I have the category in product assign and saving category below error showing
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:
and my exception.log error log is
Best Answer
There are so may issue is already reported on stack & GitHub and other community. and there are so many solutions for that and which one is correct it is to difficult choosing the right one. but I see one issue is reported on GitHub which one help to you I think. https://github.com/magento/magento2/issues/7298
This issue occurring due to duplicate entry on the database table
url_rewrite
, so there is only one way to resolve this issue you need to empty the table and regenerate the URL. so I have checked and found one answer which one usefull to me which I shared below.Note: Take database backup before doing below opration.
Remove the duplication data when saving category. This data is throw in method doReplace($urls) in
\vendor\magento\module-url-rewrite\Model\Storage\DbStorage.php
file.I found out $data variable has a duplicate record. If you want this method to work without any errors. Rewrite this method above to below one.
Taje refrance from Magento 2 Duplicate Product URLs Problem And "URL key for specified store already exists." cannot save category #7298 I hope it helps!