How to prevent users to access images, css and js files from url?

I would like to prevent users to access some files through the url. This does it.

RewriteEngine On
RewriteRule ^frontend/assets/(?:images|css|js) - [R=401,NC,L]

But, all those files are blocked and are not accessible during the normal operation of the application.
Is there a way to prevent users to access those files, and have the application worked properly ?