I\'m kind of new to the whole .htaccess thing and I\'ve been trying to modify it so that none of my links will have trailing slashes at the end of their respective URLs. My
This works for me; removing all trailing slashes from all routes while emphasizing that REQUEST_URI starts with a slash (at least in .htaccess files):
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /(.*)/$
RewriteRule ^ /%1 [R=301,L]
Just don't use %{REQUEST_URI} (.*)/$
. Because in the root directory REQUEST_URI equals /, the leading slash, and it would be misinterpreted as a trailing slash.
SOURCE: https://stackoverflow.com/a/27264788/2732184