<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /admin/

  # ✅ Force HTTPS
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

  # ✅ Redirect non-www to www
  RewriteCond %{HTTP_HOST} ^omkarfertilisers\.live$ [NC]
  RewriteRule ^(.*)$ https://www.omkarfertilisers.live/admin/$1 [R=301,L]

  # ✅ Don't rewrite existing files or directories
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # ✅ Rewrite all other routes to index.html (for Angular routing)
  RewriteRule ^.*$ index.html [L]
</IfModule>
