5

enter image description here

When I try to remove the .html suffix from category, Magento 2.2.0 gives me this error.

enter image description here

Has anyone else ran into the same problem? How can I resolve it?

Thank you

  • Did you find a solution to this? – Will Wright Dec 18 '17 at 14:59
  • Not yet. Do you have same problem on Magento 2.2.0? – Fabio Russo Dec 19 '17 at 15:22
  • 1
    I got around it by just replacing it with a / not a fix but meant I could remove the .html – Will Wright Dec 23 '17 at 10:36
  • 1
    Hi guys, i didnt fix it, but i insert a slash "/" instead of ".html" and it now load the url without ".html" suffix. – Fabio Russo Jan 4 '18 at 12:48
  • It is a 2.2.0 Magento version bug, upgrade it newest one. – Fabio Russo Apr 11 '18 at 11:05
0

This can be caused by duplicate entries for the same product in url_rewrite database table.

You can follow the below steps to solve this issue:

  • Backup your current Magento2 database
  • Delete all records from table url_rewrite. You can run the following SQL command:

    DELETE FROM url_rewrite WHERE entity_type = 'product';
    
  • Login to your Magento 2 backend

  • Re-save all your Categories
  • Clean the Magento2 cache
  • Now, you should be able to save/update the Product URL Suffix in the Configuration Settings.
  • Dear Mukesh, Please don't past the same answer to two different question. Please at least change the content. – Amit Bera Jan 17 at 8:39
  • Thanks @AmitBera for the suggestion. I will surely keep it in mind in the future. – Mukesh Chapagain Jan 18 at 6:57
0

Adding to Mukesh's answer.

After i ran the suggested step from Mukesh to delete the url_rewrites, my products where then showing as a really long format:

/catalog/product/view/id/2221/name-of-the-product

and i wanted: /name-of-the-product

So i used the following extension to regenerate the url rewrites: https://github.com/olegkoval/magento2-regenerate_url_rewrites

Also ensure URl rewrites are on: Store > Configurations > General > Web > Search Engine Optimization and set Use Web Server Rewrites to Yes

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.