# 🛡️ Ashoor TV - Server Hardening .htaccess

# 1. منع تصفح المجلدات
Options -Indexes

# 2. إخفاء معلومات السيرفر
ServerSignature Off

# 3. حماية الملفات الحساسة
<Files "config.php">
    Order allow,deny
    Deny from all
</Files>

<Files "debug.log">
    Order allow,deny
    Deny from all
</Files>

# 4. منع تنفيذ ملفات ضارة
<FilesMatch "\.(php|php5|php4|phtml|pl|py|jsp|asp|htm|html|sh|cgi)$">
    # السماح فقط بملفاتنا الأساسية
</FilesMatch>

# 5. حماية ضد Script Injection و XSS الأساسي
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # منع الطلبات المشبوهة
    RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    RewriteRule ^(.*)$ index.php [F,L]
</IfModule>

# 6. تعطيل الـ Etag لزيادة الخصوصية
Header unset ETag
FileETag None

# 7. فرض نوع المحتوى لملفات الـ API
<Files "get_video.php">
    Header set Content-Type "application/json"
</Files>
