Remove .html from URLs with a redirect

前端 未结 8 1625
一向
一向 2020-12-29 14:32

We have a website, unfortunately all the URLs have the .html suffix, its a Magento installation, Magento allows you to change this on the CMS, but again, unfort

8条回答
  •  执笔经年
    2020-12-29 14:44

    Ok so, after some research, and failing to achieve this with a rewrite rule, the following line of code worked:

    redirectMatch 301 ^(.*)\.html $1
    

    This is quite usefull to remove any url extension and avoid broken links, hopefully helps someone in the future...

    cheers!

提交回复
热议问题