# Allow access to CSS, JS, and font files only
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Allow specific file types
    RewriteCond %{REQUEST_URI} !\.(css|js|map|woff|woff2|ttf|eot|svg|ico|png|jpg|jpeg|gif)$
    RewriteRule ^ - [F,L]
</IfModule>

# Prevent directory listing
Options -Indexes

# Set caching for static assets
<FilesMatch "\.(css|js)$">
    Header set Cache-Control "max-age=31536000, public"
</FilesMatch>

<FilesMatch "\.(woff|woff2|ttf|eot|svg)$">
    Header set Cache-Control "max-age=31536000, public"
</FilesMatch>