Shuvankar Paul Software Engineer, Strativ AB Magento eCommerce Website Development, Website Development Using Php and HTML and Cross-Platform application development using Appcelerator.

How to Remove or change .html suffix from URL in Magento 2

1 min read

Magento 2 product & Category URL remove or edit or change .html

Why .html show in URL

Just Read this section before read the full article

If you just come here to Remove the .html or Other suffix from URL then go to that section directly here

And if you want to know in details how it work then read the Full Article

Default setting from Magento 2 where .html will added in the URL
Now how the URL generated. You have store URL for Ex. https://www.example.com and product URL Key will add with this.
And then Product URL Suffix

Magento 2 Full URL Logic

Store URL + URL Key + Product URL Suffix

Suppose You URL key is : https://www.example.com

Product URL Key : garlic-brown-rice-bag-250g

Product URL Suffix : .html

Full URL will be : https://www.example.com/garlic-brown-rice-bag-250g.html

For Base URL :
Go to Admin Panel, then from Menu
Stores > Configuration > Web > Base URLs or Base URLs (Secure) >Base URL or Secure Base URL

Now where URL key found

For Category URL Key
Go to Admin Panel, then from Menu
Catalog > Categories > Select any Category > Right Side – Search Engine Optimization > URL Key

For Product URL Key
Go to Admin Panel, then from Menu
Catalog > Products > Select any product >  Search Engine Optimization > URL Key

Now where is Product URL Suffix & Category URL Suffix & How to Change it

Go to Admin Panel, then from Menu
Stores > Configuration > Catalog > Catalog > Search Engine Optimization

For category it is Category URL Suffix
And for product it is Product URL Suffix
Look at the image

  1. First Step Open URL Suffix for Edit

    To change the setting, you can’t do that by default you need to unchecked the number 4 and number 5 i mean Use system value Unchecked. then the field is open for the edit

  2. For Edit or Change the URL Suffix

    give a custom text there like .php, .html or .what-ever-you-want
    and click on Save button top.

  3. For Removing the the URL Suffix

    put it blank, mean remove .html from the field, like this.

    change .html or any url suffix from url in magento 2

    Then save config button. It’s done.

  4. Clear the cache

    Now from the admin panel clear the cache

More Magento Related Article Click Here

Shuvankar Paul Software Engineer, Strativ AB Magento eCommerce Website Development, Website Development Using Php and HTML and Cross-Platform application development using Appcelerator.

Magento 2 Module etc/module.xml What,Why & How. Declaration Format…

This is the First Step of Creating new Magento 2 Module.This is called Module Declaration module.xml Location In your Module, for example VendorName_ComponentName ModuleCreate...
Shuvankar Paul
1 min read

Bulk Replace Product SKU in Magento 2

The below code and content is tested in Magento 2.3.X Sometimes you need to update the SKU in bulk process, but I will recommend...
Shuvankar Paul
55 sec read

Setting Up Magento 2 minimal & optimize environment in…

Setting Up Magento 2 minimal & optimize environment in Ubuntu including PHP, MySQL, PhpMyAdmin, PHP Extension, Composer, Folder Permission & Users
Shuvankar Paul
3 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *