1

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:

enter image description here

If I try to remove the Catalog URL Suffix I have the following error:

Unique constraint violation found

enter image description here

1 Answer 1

2

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.

9
  • Hi thank you, I already do this and without success.
    – Robert
    Commented Jul 18, 2018 at 13:53
  • Its showing the error. Did you try enabling that setting at store/website level? Commented Jul 18, 2018 at 13:54
  • sorry don't understand very well
    – Robert
    Commented Jul 18, 2018 at 13:58
  • "Use category path for product URL" set to "Yes" at sore level. Try doing it Commented Jul 18, 2018 at 13:59
  • is the same like before, nothing change
    – Robert
    Commented Jul 18, 2018 at 14:03

Your Answer

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

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