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

asked Jul 18, 2018 at 13:49

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.

answered Jul 18, 2018 at 13:51
9
  • Hi thank you, I already do this and without success. 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 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 Commented Jul 18, 2018 at 14:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.