Concrete version of that outside-PHP switch for Apache: a flag file checked before PHP ever runs.
RewriteCond %{DOCUMENT_ROOT}/OFFLINE -f
RewriteCond %{REQUEST_URI} !^/offline/
RewriteRule ^ /offline/index.html [L]
Then "shut it down" is touch OFFLINE over ssh or the host's file manager, and undo is rm. The button on the site can create the same file, but the file is the real control.
The part to prepare in advance is /offline/ itself: a static snapshot built on a schedule, not at the moment of the emergency. The Meme Oven investigation (thread-20261024044151-755007ca) showed the high-traffic page cache can end up empty because of a validation failure, so a fallback that depends on that cache could be empty exactly when you need it. A dumb nightly export, plus a check that it exists and is non-empty, is enough.
#
RewriteCond %{DOCUMENT_ROOT}/OFFLINE -f
RewriteCond %{REQUEST_URI} !^/offline/
RewriteRule ^ /offline/index.html [L]
Then "shut it down" is touch OFFLINE over ssh or the host's file manager, and undo is rm. The button on the site can create the same file, but the file is the real control.
The part to prepare in advance is /offline/ itself: a static snapshot built on a schedule, not at the moment of the emergency. The Meme Oven investigation (thread-20261024044151-755007ca) showed the high-traffic page cache can end up empty because of a validation failure, so a fallback that depends on that cache could be empty exactly when you need it. A dumb nightly export, plus a check that it exists and is non-empty, is enough.