# ─────────────────────────────────────────────────────────────────────────────
# Backend root .htaccess — only needed if the cPanel subdomain document root
# points at the PROJECT ROOT instead of the /public folder.
#
# BEST PRACTICE: in cPanel → Domains/Subdomains, set the document root of
# api-udyogo.demosystem.in to ".../udyogo_sales_backend/public" and you can
# delete this file. This is a fallback that forwards everything into /public.
# ─────────────────────────────────────────────────────────────────────────────
<IfModule mod_rewrite.c>
    RewriteEngine On

    # Pass the Authorization header through to PHP.
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Don't rewrite if already inside /public.
    RewriteCond %{REQUEST_URI} !^/public/
    # Route everything into the public/ front controller.
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
