# ================================================================
#  باشگاه آنزو — تنظیمات سرور (هاست لینوکس / Apache)
#  این فایل را همراه بقیه‌ی فایل‌ها در public_html آپلود کنید.
#  اگر هاست شما Nginx است، این فایل نادیده گرفته می‌شود و مشکلی
#  ایجاد نمی‌کند — در آن صورت از پشتیبانی هاست بخواهید معادل
#  «ریدایرکت به HTTPS» را برایتان فعال کند.
# ================================================================

# ---- انتقال اجباری به HTTPS ----
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# ---- کدگذاری پیش‌فرض فارسی ----
AddDefaultCharset UTF-8
<IfModule mod_mime.c>
  AddCharset UTF-8 .html .css .js .xml .json .txt
</IfModule>

# ---- فشرده‌سازی ----
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml
  AddOutputFilterByType DEFLATE application/javascript application/json application/xml
  AddOutputFilterByType DEFLATE image/svg+xml
  # فونت‌های woff2 از قبل فشرده‌اند؛ دوباره فشرده نمی‌شوند.
</IfModule>

# ---- کش مرورگر ----
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/html                "access plus 1 hour"
  ExpiresByType text/css                 "access plus 1 year"
  ExpiresByType application/javascript   "access plus 1 year"
  ExpiresByType image/jpeg               "access plus 1 year"
  ExpiresByType image/png                "access plus 1 year"
  ExpiresByType image/svg+xml            "access plus 1 year"
  ExpiresByType font/woff2               "access plus 1 year"
</IfModule>

# ---- امنیت ----
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# ---- صفحه‌ی پیش‌فرض ----
DirectoryIndex index.html

# ---- جلوگیری از نمایش فهرست فایل‌ها ----
Options -Indexes
