0

I know how to remove.html extensions from URLs in Magneto 2.3, but I'm unsure what other steps I need to take to make sure I do everything properly.

I found that I should also create a global redirect in .htaccess but is there anything else I should take into consideration?

This is what I found to add in .htaccess.

RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP
RewriteRule (.*)\.html$ $1 [R=301]

1 Answer 1

0

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 useful to remove any URL extension and avoid broken links, hopefully, helps someone in the future

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.