I am trying to remove ".html" from the URL. Attached are my catalog SEO setting in the Magento 2. As you can see I have remove the ".html" from both Category URL Suffix and Product URL Suffix. I'm stumped as to why it still shows the .html at the end. I have cleared all caches and reindexed all indexes.
-
Delete var folder from root and check it after browser cache.– Suresh ChikaniCommented Sep 28, 2016 at 7:33
-
I deleted everything in the root var folder, cleared all caches and it still shows .html at the end of product URL's even though it's removed from the product suffix.– Tim K.Commented Sep 29, 2016 at 2:45
-
We could not even remove the .html suffix as it presented some duplicate entry error.– WebninjaCommented Nov 8, 2016 at 20:27
3 Answers
This worked for me:
UPDATE `url_rewrite` SET `request_path` = REPLACE(`request_path`, ".html", "")
It simply removes the .html
suffix from the URL rewrites table. You then need to reindex after.
I had the same issue,
for me, all pages are working except the home page.
I did all the all settings and reindexed, cache cleared etc, but the error remained. so finally found the solution for this issue
remove "noroute" from "Default No-route URL" field under Default Page in Stores -> Configuration -> web.
Finally, filed value ll be "cms/index".
this may help one day for someone.
Here are the steps to solve the 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 theConfiguration Settings
.