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

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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