How to remove .html from Magento

There is an easy way to improve the SEO of your Magento store by removing the .html extension from the url

Example:

We have a category called Shoes

  • http://mydomain.com/default/shoes.html

And we want to have an URL like this:

  • http://mydomain.com/default/shoes

Now go to your Admin Panel. System -> Configuration. Then go to Catalog and expand the Search Engine Optimization tab.

Remove the “.html” text from both the input fields. Product URL Suffix and Category URL Suffix.

Finally the page will look like this screenshot:

Tags:

22 Responses to “How to remove .html from Magento”

  1. Alejandro December 8, 2012 at 12:56 am #

    Works fine on 1.7.0.1

    Thanks

  2. Andrew January 30, 2013 at 1:07 am #

    Once you’ve done this you need to then:

    Go to System->Index Management
    Reindex โ€œCatalog URL Rewritesโ€
    Refresh cache

    • Rick January 30, 2013 at 11:43 pm #

      Thanks for the tip Andrew! ๐Ÿ˜‰

  3. Jason Simanek (@JasonSimanek) March 3, 2013 at 3:41 am #

    Question: Why on Earth does Magento add .html? It seems like a default. And an insane one at that.

    • Rick March 3, 2013 at 10:42 am #

      I believe some SEO’s think the .html it’s better. I personally don’t ๐Ÿ™‚

  4. Jason Simanek (@JasonSimanek) March 3, 2013 at 4:16 am #

    One more question: Once you remove the .html, what happens when someone follows an old link to your site that includes the .html? Does Magento correctly redirect or do you get a 404?

    • Rick March 3, 2013 at 10:43 am #

      Haven’t tried but I think Magento is smart enough to just remove the .html without breaking the url.

      Feel free to give it a try and let us know ๐Ÿ˜‰

      Cheers.

    • Rick March 5, 2013 at 1:02 pm #

      Hi Jason,

      I’ve tried removing the .html from a test site and the old link (with .html) works just fine.

      Magento redirects and removes the .html from the URL ๐Ÿ˜‰

      Cheers.

  5. Albert March 16, 2013 at 6:57 pm #

    Hey men!

    I’m looking for how to remove /default/ on all my categories and products.

    I explain. Now, i’m having that URL:

    http://www.example.com/default/shoes/Niker52

    And i want to see:

    http://www.example.com/shoes/Niker52

    Can anyone help me with this issue?

  6. Shop June 25, 2013 at 9:50 am #

    Hi,

    I’d prefer .html for products and remove .html for categories. But I’m wondering if it’s bad for SEO removing .html from categories in a production site. Will it affect those 301 redirections? How Google will see this change of urls?

    Thank you!

    • Rick June 25, 2013 at 10:39 am #

      As far as I know it won’t directly impact on your SEO.

      Personally I think it’s better for use (UI) to not use .html

      Easier for everybody to type/remember the URL.

      Cheers.

  7. kalid March 7, 2014 at 4:01 pm #

    it’s worked for me but now pages are now without .html and return to 404 !!!

    what’s the wrong ?

    • Rick March 7, 2014 at 4:02 pm #

      Pretty sure it’s an issue with the .htaccess file.

      Does it exists in your root folder?

      If it doesn’t, you can download a clean copy of Magento from the oficial site and paste the .htaccess from that into your project.

      Let me know if this helps.

  8. jhanvee October 16, 2014 at 12:01 pm #

    hi there…i’ve installed Magento Community Edition..just for studying….but m having one problem..when i set “use web server rewrites” to “yes” in admin->system->configuration->web->seo…none of the links are workin…if i set it to “no”…then it wil work….i’ve tried every possible methods to solve this…but at the end my server got hanged……m i missing something??…i.e. any setting i didnt noticed?..

    • Rick October 16, 2014 at 12:04 pm #

      Check if the .htaccess is working, you need it. The default that comes with the Magento install should be enough, no editing needed.

      If it’s there you have to check if your local apache supports .htaccess

  9. Zakir Hosen October 13, 2015 at 8:15 pm #

    Simple instruction but is it really good practice to removing the .html from the link?

    • Rick October 13, 2015 at 9:36 pm #

      Yes, from a SEO point of view. Nobody uses it anymore.

Leave a Reply

Add <code> Some Code </code> by using this tags.