AddDefaultCharset UTF-8
Options -Indexes +FollowSymLinks

# ==========================================
# إعادة التوجيه HTTPS + WWW
# ==========================================
RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} ^al-amen\.com [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteRule (.*) https://www.al-amen.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteRule ^/?$ https://www.al-amen.com/vb/ [R=301,L]

# ==========================================
# حجب IPs المهاجمة
# ==========================================

order allow,deny
allow from all
deny from 216.73.217.21
deny from 216.73.216.0/24

# ==========================================
# حماية من البوتات على vBulletin
# ==========================================
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} /sendmessage\.php
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?al-amen\.com [NC]
RewriteRule ^ - [F,L]

# ==========================================
# إعدادات PHP المحسّنة
# ==========================================
<IfModule lsapi_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 60
   php_value max_input_time 120
   php_value memory_limit 128M
   php_value post_max_size 20M
   php_value session.gc_maxlifetime 1440
   php_value upload_max_filesize 10M
   php_flag zlib.output_compression Off
</IfModule>


<Files 403.shtml>
order allow,deny
allow from all
</Files>

# ==========================================
# PHP Handler
# ==========================================
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
deny from 57.141.0.0/24

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
