<IfModule mod_rewrite.c>
RewriteEngine on

#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f

# Mantener los errores dentro del mismo dominio evita bloqueos CORS en peticiones AJAX
ErrorDocument 404 "Archivo no encontrado"

RewriteRule ^login$ index.php [L]
RewriteRule ^logout$ action/logout.php [L]

Options All -Indexes
</IfModule>

# Los secretos y artefactos de desarrollo nunca deben servirse por HTTP.
<FilesMatch "^(composer\.(json|lock)|.*\.sql|.*\.log|\.env.*)$">
    Require all denied
</FilesMatch>

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

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-alt-php82___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
