Solved: Magento 2 Product URLs Double html Suffix Problem

Have you recently migrated to Magento 2? Are your product URLs end with .html.html?

Working on customizations and Magento 2 migration, we recently faced an issue. After Magento 1 to Magento 2 migration, the imported product URLs were having double html suffix.

Original URL: example.com/tshirt.html

With double .html suffix problem: example.com/tshirt.html.html

Steps to get rid of Magento 2 Product URLs Double html Suffix Problem:

  1. Take the backup of your current Magento 2 database.
  2. Run the following command in your Magento 2 database:
    UPDATE url_rewrite SET request_path = REPLACE(request_path, '.html.html', '.html') WHERE url_rewrite.request_path like '%html.html';
  3. Run the below command to flush the cache
    bin/magento cache:flush

That’s it and double html suffix in Magento 2 product page issue is no longer there! Still, stuck somewhere while implementing the solution or having any question regarding it? Do comment your queries and I will be happy to help! You can get all products URL in Magento 2 and check the results to see if the problem persists!

Don’t forget to share the solution to other Magento community members!

Table of Contents