Maintenance Page Force Redirect

Last updated: March 28, 2011

Should you want to put a website in standby prior to migration or updates, the following .htaccess entry will prevent any URL of your domain from being accessed and forcefully redirect it to the desired maintenance page.

First create an html document (in this example: maintenance.html) with the desired content such as "Scheduled maintenance ... please check back shortly."

/home/username/public_html/maintenance.html
<html>Scheduled maintenance ... please check back shortly.</html>

/home/username/public_html/.htaccess
RedirectMatch \.(dynamiccontent|pl|plx|perl|cgi|php|php4|php4|php6|php3|shtml)$ http://yourdomain.com/maintenance.html

Tags: maintenance, redirect