# ═══════════════════════════════════════════════════════
# 🎬 PlayIMDb - Configuración para SUBCARPETA /peli/
# ═══════════════════════════════════════════════════════

RewriteEngine On

# ️ IMPORTANTE: Define la base de la URL
RewriteBase /peli/

# 🔒 Seguridad básica
Options -Indexes

# Si existe el archivo real (img, css, js), no hacer nada
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# 🔄 REDIRECCIÓN INTELIGENTE:
# Captura cualquier texto después de /peli/ y lo pasa a index.php
# Ej: tudominio.com/peli/matrix  ->  index.php?q=matrix
RewriteRule ^(.+)$ index.php?q=$1 [L,QSA]