Options -Indexes

# منع الوصول لملفات إعدادات
<Files ~ "^\.ht">
  Require all denied
</Files>

# منع تنفيذ أي سكربت داخل uploads
<FilesMatch "\.(php|phtml|php[0-9]?|phar|cgi|pl|py|sh|shtml|jsp|asp|aspx)$">
  Require all denied
</FilesMatch>

# إزالة معالجات PHP إن وُجد
<IfModule mod_php.c>
  php_flag engine off
</IfModule>
<IfModule mod_mime.c>
  RemoveType .php .phtml .php3 .php4 .php5 .php7 .php8 .phar
</IfModule>
<IfModule mod_actions.c>
  Action application/x-httpd-php -
</IfModule>

# حماية من الامتداد المزدوج
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} \..*\.(php|phtml|php[0-9]?|phar|cgi|pl|py|sh|shtml|jsp|asp|aspx)$ [NC]
RewriteRule .* - [F,L]
</IfModule>

# (اختياري) تشديد إضافي للسماح فقط بصيغ محددة:
# <FilesMatch "\.(jpe?g|png|gif|webp|pdf|docx|xlsx)$">
#   Require all granted
# </FilesMatch>
# <FilesMatch ".*">
#   Require all denied
# </FilesMatch>
