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:
- Take the backup of your current Magento 2 database.
- Run the following command in your Magento 2 database:
1UPDATE url_rewrite SET request_path = REPLACE(request_path, '.html.html', '.html') WHERE url_rewrite.request_path like '%html.html'; - Run the below command to flush the cache
1bin/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!
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Disable Ajax Add to Cart on Product page in Magento 2
How to Get Static Block Content in Block File in Magento 2
Next