Options -Indexes
RewriteEngine On

# Block direct access to sensitive directories (config, database)
RewriteRule ^(.*/)?(config|database)(/|$) - [F,L]

# Block storage except the uploads folder (for logos and proofs)
RewriteRule ^(.*/)?storage/(?!uploads/)(.*)$ - [F,L]

# Route admin directory to index.php (This fixes the 403 Forbidden error)
RewriteRule ^admin(/.*)?$ index.php [QSA,L]

# Route all other requests to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]