<IfModule mod_rewrite.c>
    RewriteEngine On

    # URL prefix of this project (must match the folder name under htdocs).
    # Needed on Windows so relative targets become URLs, not file paths.
    RewriteBase /Invoice_lara/

    # This project is served from its ROOT folder (not /public), and Laravel
    # generates every URL under /public/. So forward root-level page requests
    # to the matching /public/ URL, where public/index.php lives.

    # 1) Bare folder: /Invoice_lara/ -> /Invoice_lara/public/
    RewriteRule ^$ public/ [R=302,L]

    # 2) Pages and assets that don't exist here:
    #    /Invoice_lara/login -> /Invoice_lara/public/login
    #    (requests already inside /public/ are left to public/.htaccess)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} ![/\\]public([/\\]|$)
    RewriteRule ^(.*)$ public/$1 [R=302,L]
</IfModule>

# Don't expose the application source folders (app, config, database, ...).
Options -Indexes
