# ---------------------------------------------------------------------------------------------
# SHARED HOSTING: use this file when the domain's document root is the project folder and you
# cannot point it at public/. Every request is served from public/, so app/, system/, writable/
# and .env are never reachable from the web. (If your host lets you set the document root to
# the public/ folder, do that instead; this file is then simply not used.)
# Works on a domain or sub-domain root (not inside a sub-folder like example.com/mandir/).
# ---------------------------------------------------------------------------------------------
Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^$ public/ [L]
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Safety net if mod_rewrite is ever switched off: never serve secrets or source files.
<FilesMatch "^(\.env.*|spark|composer\.(json|lock)|CLAUDE\.md|.*\.(md|sql|log|lock|php-cs-fixer.*))$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# Apache mod_php only (ignored elsewhere): upload limits for photos + video
<IfModule mod_php.c>
    php_value upload_max_filesize 60M
    php_value post_max_size 100M
    php_flag html_errors off
    php_flag display_errors off
</IfModule>
