# ----------------------------------------------------------------------
# SAFE SECURITY HEADERS (No PHP Configs)
# ----------------------------------------------------------------------

# 1. Directory List Chupana (Folders open nahi honge)
Options -Indexes

# 2. Sensitive Files Protect Karna (Database file hack nahi hogi)
<FilesMatch "^(db\.php|config\.php|\.env|database\.sql|\.user\.ini)">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# 3. Security Headers (Attacks se bachne ke liye)
<IfModule mod_headers.c>
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Content-Type-Options "nosniff"
</IfModule>

# 4. Bad Urls Block Karna
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]
    RewriteRule ^(.*)$ - [F,L]
</IfModule>

# 5. Error Pages (Agar koi galat page khole to index par bhejo)
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php