I use Magento 2.2.4 version, if I open a subcategories my URL have .html suffix in both: category and subcategory.
The url is look like this:
https://www.example.com/en/clothes.html/pants.html
and the product
https://www.example.com/en/clothes/pants.html/hot-pants.html
How I can made the url for categories to be like this:
https://www.example.com/en/clothes/pants.html
and the same for product, to remove the html suffix from url too:
https://www.example.com/en/clothes/pants/hot-pants.html
My Catalog SEO configuration is:
If I try to remove the Catalog URL Suffix I have the following error:
Unique constraint violation found
 1 Answer 1
To re-generate all Url rewrites of the categories/products in all stores (it support a multi stores) run:
php bin/magento ok:urlrewrites:regenerate
To regenerate Url rewrites in the specific store view (e.g.: store view id is "2"):
php bin/magento ok:urlrewrites:regenerate 2
Don't forget to reindexing and flush the cache.
- 
 Hi thank you, I already do this and without success.Robert– Robert2018年07月18日 13:53:26 +00:00Commented Jul 18, 2018 at 13:53
 - 
 Its showing the error. Did you try enabling that setting at store/website level?Abhishek Panchal– Abhishek Panchal2018年07月18日 13:54:47 +00:00Commented Jul 18, 2018 at 13:54
 - 
 sorry don't understand very wellRobert– Robert2018年07月18日 13:58:37 +00:00Commented Jul 18, 2018 at 13:58
 - 
 "Use category path for product URL" set to "Yes" at sore level. Try doing itAbhishek Panchal– Abhishek Panchal2018年07月18日 13:59:25 +00:00Commented Jul 18, 2018 at 13:59
 - 
 is the same like before, nothing changeRobert– Robert2018年07月18日 14:03:51 +00:00Commented Jul 18, 2018 at 14:03