# AMP folder - standalone
Options -Indexes -MultiViews
DirectoryIndex index.php

# Lindungi file internal
<FilesMatch "^(list\.txt|config\.php)$">
    Require all denied
</FilesMatch>

<IfModule mod_rewrite.c>
    RewriteEngine On

    # /img/{brand}.png -> img.php?brand={brand} (banner generator lokal)
    RewriteRule ^img/([A-Za-z0-9_-]+)\.png$ img.php?brand=$1 [L,NC]

    # /amp/{brand} -> index.php?main={brand}
    # Tetap mengizinkan akses ke file/folder yang benar-benar ada
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([A-Za-z0-9_-]+)/?$ index.php?main=$1 [L,NC,QSA]
</IfModule>

# Cache statis ringan
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/png "access plus 30 days"
</IfModule>

# Header keamanan dasar
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
