# ---------------------------------------------------------------------------
# DLSJBC Proof of Payment Portal - root Apache configuration
#
# The application folder is served directly by Apache, so the files that hold
# the configuration and the database schema must never be requested over HTTP.
# ---------------------------------------------------------------------------

# The environment file holds the database password, the SMTP credentials and
# the encryption key. It is the most important file to keep private.
<FilesMatch "^\.env">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</FilesMatch>

# Version control and editor folders (.git, .svn, .vscode, ...).
<FilesMatch "^\.(git|svn|hg|kilo|kiro|vscode|idea)">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</FilesMatch>

# Database dumps, logs and backup files.
<FilesMatch "\.(sql|log|ini|bak|old|orig|save|swp|dist)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</FilesMatch>
