0

How can I remove .html from Magento 2catergory URL and product URL. I'm getting a Unique constraint violation issue.

0

As per Magento Official Guide, you can change like this:

  1. On the Admin sidebar, go to Stores > Settings > Configuration.
  2. In the left panel, expand Catalog and choose Catalog underneath.
  3. Expand the Search Engine Optimizations section and set the options:
  • Set Product URL Suffix to html or htm. Enter the suffix without a period, because it is applied automatically.

  • Set Category URL Suffix to html or htm. Enter the suffix without a period, because it is applied automatically.

  • Set Use Categories Path for Product URLs to your preference.

  1. When complete, click Save Config.
  2. When prompted, click the Cache Management link in the system message and refresh the invalid cache.
1

As per the instructions presented in the official documentation http://docs.magento.com/user-guide/catalog/catalog-urls.html#configure-catalog-urls, just go in the admin to Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization and replicate the below settings (uncheck 'Use system value' for Product URL suffix and Category URL suffix and remove the '.html' value from the inputs):

enter image description here

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.