Hi and welcome to LQ,
Can you give more details about what you're trying to accomplish.
Maybe using a "/" in the rule should do, because without it the URL:
https://servername/dir (without the trailing slash) doesn't work.
Code:
RewriteRule ^(.*)/$ $1/ [R]