I had migrated my store from Magento 1 and I'm having many URLs that contain .html.html in the final of the string.

I want to update all my 88187 URL rewrites, replacing .html.html to .html

I already checked my URL suffix and prefix, and the product and category URLs registered in the admin panel.

Magento2 URL rewrite

How could I do that via SQL in the url_rewrite table?

1 Answer 1


To fix it I ran this SQL query below.

SELECT * FROM `url_rewrite` WHERE `request_path` LIKE '%html.html' AND `redirect_type` LIKE '0';

UPDATE `url_rewrite` SET request_path = REPLACE(request_path, '.html.html', '.html') WHERE `request_path` LIKE ('%html.html') AND `redirect_type` LIKE '0';

Or you can install the Elgento module and run its commands as bellow.

composer require elgentos/regenerate-catalog-urls
php bin/magento module:enable Iazel_RegenProductUrl
php bin/magento setup:upgrade
php bin/magento repair:url
  • Also,Please check Your URL suffix is .html.html or .html, if its is .html.html then changes it at core_config_data table
    – Amit Bera
    Oct 9, 2019 at 6:23

Your Answer

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

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