Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^go/([a-zA-Z0-9][a-zA-Z0-9-]{2,79})/?$ go.php?alias=$1 [QSA,L]
RewriteRule ^$ domain.php [QSA,L]
RewriteRule ^m/([a-zA-Z0-9]+)/?$ menu.php?code=$1 [QSA,L]
RewriteRule ^r/([a-zA-Z0-9-]+)/?$ menu.php?slug=$1 [QSA,L]
RewriteRule ^(?:app|config|database|storage|cron|docs|react-src|ai-gateway|cli|tools)(?:/|$) - [F,L,NC]
</IfModule>

<FilesMatch "\.(sql|sqlite|db|log|ini|env)$">
  Require all denied
</FilesMatch>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json
</IfModule>

<FilesMatch "^(?:README\.md|EMPIEZA-AQUI\.txt|REPORTE-DE-ENTREGA\.txt|VALIDACION_FINAL\.txt|CHECKLIST_PRODUCCION\.txt|GUIA_PRIMER_USO\.txt|REQUISITOS_SERVIDOR\.txt|VERSION|MANIFEST\.sha256)$">
  Require all denied
</FilesMatch>
