# ============================================================
# .htaccess — ai.futureeducation.eu
# LiteSpeed / cPanel (hosting24.com)
# Last updated: 2026-03-29
# ============================================================


# ============================================================
# CORS — позволява браузърите да fetch-ват JSON файловете
# ============================================================
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, OPTIONS"
    Header set X-Robots-Tag "all"
</IfModule>

<FilesMatch "\.(json)$">
    Header set Access-Control-Allow-Origin "*"
</FilesMatch>


# ============================================================
# MIME TYPES
# ============================================================
<IfModule mod_mime.c>
    AddType application/json .json
    AddType text/plain .txt
</IfModule>


# ============================================================
# КЕШИРАНЕ
# ============================================================
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html                "access plus 1 hour"
    ExpiresByType text/plain               "access plus 1 day"
    ExpiresByType application/json         "access plus 1 day"
    ExpiresByType text/css                 "access plus 1 month"
    ExpiresByType application/javascript   "access plus 1 month"
    ExpiresByType image/png                "access plus 1 month"
    ExpiresByType image/jpeg               "access plus 1 month"
    ExpiresByType image/webp               "access plus 1 month"
</IfModule>


# ============================================================
# СИГУРНОСТ
# ============================================================
ServerSignature Off
Options -Indexes

<Files ".htaccess">
    Require all denied
</Files>


# ============================================================
# HTTPS REDIRECT
# ============================================================
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
