# ── Non-indexation ──────────────────────────────────────────
Header always set X-Robots-Tag "noindex, nofollow, noarchive"

# ── Bloquer les crawlers par User-Agent ──────────────────────
RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} (Googlebot|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Sogou|Exabot|facebot|ia_archiver|AhrefsBot|SemrushBot|MJ12bot|DotBot|BLEXBot|proximic|Screaming\ Frog) [NC]
RewriteRule ^ - [F,L]

# ── Bloquer l'accès direct (hors Telegram) ──────────────────
# Si le Referer est absent ET que ce n'est pas une ressource statique
# → renvoyer une page vide / erreur

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_REFERER} ^$
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} \.php$
RewriteRule ^ - [R=403,L]

# ── Sécurité basique ─────────────────────────────────────────
Options -Indexes
ServerSignature Off

# ── Limites upload pour les vidéos ───────────────────────────
<IfModule mod_php.c>
    php_value upload_max_filesize 100M
    php_value post_max_size       105M
    php_value memory_limit        256M
    php_value max_execution_time  300
    php_value max_input_time      300
</IfModule>
<IfModule mod_php8.c>
    php_value upload_max_filesize 100M
    php_value post_max_size       105M
    php_value memory_limit        256M
    php_value max_execution_time  300
    php_value max_input_time      300
</IfModule>
<IfModule mod_php7.c>
    php_value upload_max_filesize 100M
    php_value post_max_size       105M
    php_value memory_limit        256M
    php_value max_execution_time  300
    php_value max_input_time      300
</IfModule>
