# RUI OU GARAGE E83 public root. Requires Apache 2.4 mod_rewrite.
Options -Indexes
DirectoryIndex index.php app.html

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Never serve credentials, deployment material, or dotfiles from the webroot.
    RewriteRule ^(?:\.env(?:\.|$)|\.git(?:/|$)|\.user\.ini$|composer\.(?:json|lock)$|package(?:-lock)?\.json$) - [F,L,NC]
    RewriteRule ^(?:database|docs|private|source)(?:/|$) - [F,L,NC]
    # app.html is read by index.php so route-specific headers/robots handling
    # cannot be bypassed by requesting the built shell directly.
    RewriteRule ^app\.html$ - [F,L,NC]

    # API requests are handled by the parent-owned front controller.
    RewriteRule ^api/garage(?:/.*)?$ index.php [L,QSA]

    # Existing files/directories (assets, images, uploads, favicon) remain static.
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Client-side routes and all other non-files use the front controller.
    RewriteRule ^ index.php [L,QSA]
</IfModule>

# Do not add php_value/php_flag directives here: cPanel PHP may use PHP-FPM
# or a handler that rejects those directives. Configure supported values in
# cPanel MultiPHP INI Editor or an optional .user.ini instead.
