# منع الوصول المباشر إلى المجلد
Options -Indexes

# السماح بالوصول إلى الملفات المسموح بها فقط
<FilesMatch "\.(?i:jpg|jpeg|png|gif|pdf|doc|docx|xls|xlsx|zip)$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

# منع تنفيذ الملفات PHP
<FilesMatch "\.(?i:php|phtml|php3|php4|php5|php7|phps)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# تعيين نوع المحتوى للملفات
<IfModule mod_mime.c>
    AddType application/pdf .pdf
    AddType application/msword .doc
    AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx
    AddType application/vnd.ms-excel .xls
    AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xlsx
    AddType application/zip .zip
    AddType image/jpeg .jpg .jpeg
    AddType image/png .png
    AddType image/gif .gif
</IfModule>

# تعيين سياسة أمان المحتوى
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
</IfModule>
