I'm trying to disable the website I deployed on my test server with Capifony.
The maintenance.html file goes up, everything's ok with the web:disable/enable commands.
My only problem is how to detect the maintenance file, and redirect to it using the .htaccess file provided by Symfony.
(I thought of detecting the maintenance file in the app_*.php scripts, but not only it feels hacky, it wouldn't disable access to the other files in the web/ folder.)
Any advice is greatly appreciated.
You can disable access directly by rewrite rule in your webserver config. If maintenance.html file found redirect to it, or to another static page. For Apache's htaccess it will be something like this:
RewriteCond %{DOCUMENT_ROOT}/web/maintenance.html -f
RewriteRule ^/(.+) /web/maintenance.html [QSA,L] [L,QSA]