# Front controller: route any path that is not a real file or directory
# through index.php. Real files (assets, admin/*.php) and directories serve
# directly and bypass the router.

<IfModule mod_rewrite.c>
    RewriteEngine On

    # If serving from a subfolder (local MAMP), match BASE_PATH here.
    # For the production domain root, change this to: RewriteBase /
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [QSA,L]
</IfModule>

# Don't expose the config or SQL dump even if rewriting is disabled.
<FilesMatch "^(config\.php|schema\.sql)$">
    Require all denied
</FilesMatch>
