# Root .htaccess for Samanta CRM
<IfModule mod_rewrite.c>
RewriteEngine On

# Handle assets directly
RewriteRule ^assets/(.*)$ public/assets/$1 [L]

# Handle API or specific file requests
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

# Route everything else to public folder, but avoid double routing
RewriteCond %{REQUEST_URI} !^/samanta_crm/public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
