<p>I want:
all links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: <a href="http://mysite.com/article" rel="nofollow noreferrer">http://mysite.com/article</a> -> <a href="http://mysite.com/article/" rel="nofollow noreferrer">http://mysite.com/article/</a>
But <a href="http://mysite.com/article/article-15.html" rel="nofollow noreferrer">http://mysite.com/article/article-15.html</a> not redirects.
What regulat expression I must write to .htaccess for adding slash to virtual directories?</p>

[{'answer_id': 81648, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Clarification needed:</p>\n\n<p>Given the url:\n<a href="http://server/path/file" rel="nofollow noreferrer">http://server/path/file</a></p>\n\n<p>Does that get redirected to:\n<a href="http://server/path/" rel="nofollow noreferrer">http://server/path/</a></p>\n\n<p>Or does it get redirected to:\n<a href="http://server/path/file/" rel="nofollow noreferrer">http://server/path/file/</a></p>\n\n<p>As in: Do you want the redirects to go to the parent path, or do you just want to add a slash and assume directory out of the current path?</p>\n'}, {'answer_id': 81760, 'author': 'MB.', 'author_id': 11961, 'author_profile': 'https://Stackoverflow.com/users/11961', 'pm_score': 3, 'selected': True, 'text': '<p>I think the following might work:</p>\n\n<pre><code>RewriteEngine on   \nRewriteCond %{REQUEST_URI} ^/[^\\.]+[^/]$\nRewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]\n</code></pre>\n\n<p>When it comes to mod_rewrite I can never be sure without testing though...</p>\n'}, {'answer_id': 193294, 'author': 'eyelidlessness', 'author_id': 17964, 'author_profile': 'https://Stackoverflow.com/users/17964', 'pm_score': 0, 'selected': False, 'text': "<p>MB's RewriteRule above will fail on paths like <code>/a</code> because it needs to match at least two characters after the slash. Moreover it only matches on top directory URLs.</p>\n\n<pre><code>RewriteRule ^(([^\\/]+\\/)*[^\\/\\.]+)$ http://%{HTTP_HOST}/$1/ [R=301,L]\n</code></pre>\n\n<p>Is the purpose of this to reduce history pollution/false negatives?</p>\n"}]
['https://Stackoverflow.com/questions/81631', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13427/']