I found that the common configuration available on the Internet didn't work for me. Specifically, the Apache Rewrite rule needs to reference DOCUMENT_ROOT. Here are my rewrite rules; remember that for this to work, they have to be first:
I am a computer programmer and racounteur entrepreneur based in Baltimore.
RewriteCond %{DOCUMENT_ROOT}system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ %{DOCUMENT_ROOT}system/maintenance.html [L]
3 comments:
I like to slap in a line to let through css + images too, so maintenance pages can be a bit pretty. I put the following just before your lines above:
RewriteCond %{REQUEST_URI} !\.(css|jpg|png|gif)$
That's very timely Dr. Nic, as I was just today about to code a custom maintenance page and I'm sure that would have tripped me up. Thanks!
You should prepend "system" with a "/" because the DocumentRoot should be specified without a trailing slash.
Post a Comment