# محافظت از پوشه آپلودها
# Protection for uploads directory

# جلوگیری از لیست کردن فایل‌ها
# Prevent directory listing
Options -Indexes

# جلوگیری از اجرای PHP و script‌های خطرناک
# Prevent execution of PHP and dangerous scripts
<FilesMatch "\.(php|phtml|php3|php4|php5|phps|cgi|exe|pl|asp|aspx|shtml|shtm|fcgi|fpl|jsp|sh|bat|cmd|com|scr|vbs|js|jar|war|ear|class|py|rb|rhtml|jspx|jspf)$">
    Order Deny,Allow
    Deny from all
</FilesMatch>

# جلوگیری از اجرای PHP در این پوشه
# Prevent PHP execution in this directory
<FilesMatch "\.php$">
    Order Deny,Allow
    Deny from all
</FilesMatch>

# جلوگیری از اجرای script‌های دیگر
# Prevent execution of other scripts
RemoveHandler .php .phtml .php3 .php4 .php5 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .js
RemoveType .php .phtml .php3 .php4 .php5 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .js

# تنظیمات امنیتی برای فایل‌های تصویری
# Security settings for image files
<IfModule mod_headers.c>
    <FilesMatch "\.(png|jpg|jpeg)$">
        # اجازه نمایش تصاویر در مرورگر (برای نمایش در پنل)
        # Allow displaying images in browser (for panel display)
        Header set Content-Type "image/%{REQUEST_URI:e}"
        Header set Cache-Control "public, max-age=3600"
    </FilesMatch>
</IfModule>
