Trailing slash in Symfony route

I found several approaches to get rid of the annoying 404-error when you open a route with a trailing-slash:
>> ok
>> Error: 404-not found

The easiest solution is to add a RewriteRule to your .htaccess:

Now all requests with trailing-slash are redirected to the one without trailing-slash.

Notice that this only works as long as you do not have any routes which want require a trailing slash, because this would lead to an redirect loop: