# JTECH CORPORATE - Apache URL Rewriting
# Developed by JHAPA TECHNICAL PVT. LTD.
#
# Routes any request that does NOT match a real file or directory
# through index.php (the front controller), so clean URLs like
# /login, /dashboard, /members/5 work. Requests that DO match a real
# file — such as /install/index.php — are served directly and never
# touch index.php, exactly like the built-in PHP dev server behavior
# this app was tested against.
#
# This file must live in the same folder as index.php (the document
# root your web server points at — e.g. "public/", or "coop/" if
# that's what your host's document root is set to).

<IfModule mod_rewrite.c>
    RewriteEngine On

    # If the request maps to a real file or directory, serve it as-is
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Otherwise, route through the front controller
    RewriteRule ^ index.php [L]
</IfModule>

# Never serve raw .sql, .env, or config source files even if requested directly
<FilesMatch "\.(sql|env)$">
    Require all denied
</FilesMatch>
