Files
nis2-agile/public/.htaccess
T
DevEnv nis2-agileandClaude Opus 4.8 2a5d90f8bb [OPS] Manutenzione flag-gated: .htaccess (503→maintenance.html) + pagina + bypass token
Meccanismo riusabile: presenza di ../.maintenance (gitignored) → ogni richiesta 503 +
maintenance.html (mostra la finestra). Bypass ?mnt=<token>/cookie. Accendi: touch
.maintenance · Spegni: rm .maintenance. Attivato ora per il revamp UI V3 (~1h).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 10:42:29 +02:00

29 lines
1.4 KiB
ApacheConf

RewriteEngine On
# ══════════════════════════════════════════════════════════════════════════
# MANUTENZIONE (flag-gated): se esiste <docroot>/../.maintenance, OGNI richiesta
# → HTTP 503 + maintenance.html. Bypass: ?mnt=<token> o cookie nis2_mnt=<token>.
# Accendere: touch ../.maintenance · Spegnere: rm ../.maintenance (istantaneo)
# ══════════════════════════════════════════════════════════════════════════
ErrorDocument 503 /maintenance.html
RewriteCond %{DOCUMENT_ROOT}/../.maintenance -f
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteCond %{QUERY_STRING} !(^|&)mnt=efc088d042032889b64b887d2e562ec8(&|$)
RewriteCond %{HTTP_COOKIE} !nis2_mnt=efc088d042032889b64b887d2e562ec8
RewriteRule ^ - [R=503,L]
# Pass Authorization header to PHP-FPM
RewriteCond %{HTTP:Authorization} .+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect HTTP to HTTPS (production)
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# If file or directory exists, serve directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Route everything through index.php
RewriteRule ^(.*)$ index.php [QSA,L]