# Block access to install directory after installation
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_URI} ^/install/
    RewriteCond %{DOCUMENT_ROOT}/config.php -f
    RewriteRule ^ - [F,L]
</IfModule>

# Prevent directory listing
Options -Indexes

# Protect sensitive files
<FilesMatch "^(config\.php|.*\.sql)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# Allow access to bot.php for webhook
<Files "bot.php">
    Order Allow,Deny
    Allow from all
</Files>