# .htaccess file to configure Apache for serving static assets and resolving 403 errors # Disable directory indexing to prevent listing of directory contents Options -Indexes # Ensure static files (images, CSS, JS) are accessible Order Allow,Deny Allow from all # Explicitly allow access to the assets directory Options +FollowSymLinks AllowOverride All Require all granted # Prevent hotlinking (optional, comment out if not needed) # RewriteEngine On # RewriteCond %{HTTP_REFERER} !^$ # RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] # RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F] # Enable mod_rewrite for URL rewriting (if needed for your site) RewriteEngine On # Redirect to index.html for root access (optional, adjust as needed) RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.html [L] # Set cache control for static assets to improve performance ExpiresActive On ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" # Enable compression for faster loading (if mod_deflate is available) AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript