How to remove .html from your Magento store’s category URLs

Magento is a great ecommerce platform for search engines out of the box, but there are a few changes we make for most clients launching their stores on Magento Community or Magento Enterprise Editions for search engines.

One of these is quite a small change, but helps your store URLs look a lot neater (as well as being a little shorter for use on social media sites such as Twitter and Facebook!): this is removing the default .html suffix Magento adds to all product and category URLs.

Magento default category and product URL suffixes

Magento’s default setting is to add a .html suffix to the end of your product and category URLs. So, for example, your “Blue T-shirt” product page may look like:

whilst your “T-shirt” category page URL in your Magento store may be something like:

Removing the automatically-applied .html suffix from your store’s URLs would mean:

  • Product URLs look more like
  • Category URLs look more like

Removing .html from your Magento store’s product and category URLs

To remove the .html suffix Magento adds to your Magento store’s product and category URLs, log in to your Magento administration panel.

Navigate to the System > Configuration screen. From there, locate the Catalog (Or Catalogue) section in the left-hand menu:

Remove HTML product and category URL suffix in Magento

Under the Search Engine Optimizations (or Search Engine Optimisations) panel here, remove the .html values for the following fields you can see in the screenshot below:

  • Category URL Suffix
  • Product URL Suffix

Once you have done this, click the Save Config button. You may now need to reindex your store to see the new URL structure.

Beware removing the suffix on live Magento stores!

A little warning: if you’re removing the suffix for your products and categories on a live Magento store, you will need to ensure that the old URLs (containing the .html at the end) are redirected properly (ideally using a HTTP 301 permanent redirect) to their new addresses, to prevent any loss in search engine rankings or traffic to your website!

There’s no real benefit for search engines to removing the .html suffix, but it certainly looks neater, and is a lot more “future proof” for your URLs – “Cool URIs don’t change” is good background reading on this!