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.

A Full Guide to Make Mac Environment for any…

Mac is Shipped with some predefined tools for US PHP – will Depreciated in next MacOS release Apache You can check with Install Http...
Shuvankar Paul
6 min read

Disable Magento 2 Two Factor Authentication

In new Magento Version by Default Magento 2 Enable Two Factor Authentication, but if you work on localhost, then it is not useful for...
Shuvankar Paul
12 sec read

Magento 2 Common Manual MySQL Query

Getting Number of Active Product in a Category
Shuvankar Paul
54 sec read

Leave a Reply

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