Redirecting Apache traffic to a maintenance page

Here’s a simple solution to redirect users to a maintenance page in Apache. This rewrite rule can stay in your config (<VirtualHost> or .htaccess) all the time; all that you need to enable it is to create the file maintenance.html.

The first rewrite condition checks to see if the file exists, and only if it does, will it redirect all traffic to it. The second rewrite condition is there to prevent an infinite loop, by only redirecting traffic to files other than maintenance.html.

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{REQUEST_FILENAME} !/maintenance.html
RewriteRule ^.*$    /maintenance.html [L]
2010-05-03 [, , ]
View Comments

Apache, PHP and MongoDB on Mac OS X 10.6 Snow Leopard

MongoDB (from “humongous”) is a scalable, high-performance, open source, schema-free, document-oriented database.

There’s a lot of buzz brewing about it, so I wanted to give it a try with PHP on my development Mac. The following is how I went about installing Apache, PHP and MongoDB on Snow Leopard. You must have installed the Xcode developer tools (found on the Snow Leopard install DVD) and MacPorts for this to all work.

(more…)