Skip to content

Remove trailing slashes from store URL’s – Magento 2.4

We set the “Add Store Code to URLs” option to Yes, so now our store URL’s looks like:

https://www.example.com/en/
https://www.example.com/de/
https://www.example.com/fr/

And by default Magento redirects the url without the last slash to the url with a slash.
So https://www.example.com/en redirects to https://www.example.com/en/

How can we disable this?
We want to transform our urls into:

https://www.example.com/en
https://www.example.com/de
https://www.example.com/fr