Magento – How to remove trailing slash from Magento 2 url

.htaccessmagento2redirecturlurl-rewrite

I have installed ssl in my Magento 2 store and configured base url to the https version.

But when accessing http version, Magento redirecting url with appending trailing slash.

For example:

My domain is example.com

Base url saved in configuration is https://www.example.com

When I accessing http version http://www.example.com/contactus.html

it is redirecting to https://www.example.com/contactus.html/

Could you please help to remove the trailing slash while redirecting.

Best Answer

Magento admin you can use store direct_url for remove trailing slash.

example:

<a href="{{store direct_url='contact-us'}}">Contact</a>
Related Topic