# =========================================================================
# GÜVENLİK KORUMASI: Yükleme Dizininde Kod Çalıştırılmasını Engelle
# =========================================================================

# 1. Dizin listelemeyi ve CGI çalıştırmayı engelle
Options -Indexes -ExecCGI -MultiViews

# 2. PHP Engine Kapatma (Apache mod_php / php7 / php8 / LiteSpeed)
<IfModule mod_php.c>
    php_flag engine off
</IfModule>
<IfModule mod_php7.c>
    php_flag engine off
</IfModule>
<IfModule mod_php8.c>
    php_flag engine off
</IfModule>

# 3. Yürütülebilir script dosyalarına doğrudan erişimi engelle (Apache 2.2 ve 2.4 Uyumlu)
<FilesMatch "(?i)\.(php|phtml|php3|php4|php5|php7|php8|phps|pht|phar|sh|pl|cgi|py|exe|bat|cmd|htaccess|env|sql)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order Deny,Allow
        Deny from all
    </IfModule>
</FilesMatch>

# 4. MIME türünü düz metin veya statik dosyaya zorla
<IfModule mod_mime.c>
    RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .php8 .phar .sh .cgi
    RemoveType .php .phtml .php3 .php4 .php5 .php7 .php8 .phar .sh .cgi
    AddType text/plain .php .phtml .php3 .php4 .php5 .php7 .php8 .phar .sh .cgi
</IfModule>
