# ============================================================
#  POOJA API — Apache configuration
#  Place this folder at: C:\xampp\htdocs\pooja-api
#  All requests to /pooja-api/* are routed to index.php
# ============================================================

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Prevent direct access to internal paths
    RewriteRule ^(config|core|models|middleware|controllers|sql)/ - [F,L]
    RewriteRule ^cache/ - [F,L]

    # If the request is not a real file or directory, route to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

# Serve uploads with long cache + no execution
<IfModule mod_headers.c>
    <FilesMatch "\.(jpg|jpeg|png|webp|gif)$">
        Header set Cache-Control "public, max-age=31536000"
    </FilesMatch>
</IfModule>

# Disable directory listing
Options -Indexes

# PHP settings
<IfModule mod_php.c>
    php_value upload_max_filesize 10M
    php_value post_max_size 12M
</IfModule>
