May 6th, 2011 - By Bowo

As a web designer, sometimes we must change some code or design in our website, and when that process happen and visitor came to your site, what will they look? AN UGLY WEBSITE, because we still fixing some part of that site.. Of course you don’t want that happen right?

But how we can avoid that? we want the web look perfect but we also dont want people look the ugly face of the website when the process happen, well the answer is MAINTENANCE MODE. Yup you must make your website into a maintenance mode, so when visitor came to your site they not see the ugly face of the web but the announcement from you. Now how to make that “maintenance mode” thing?

For static site you can use .htaccess to help you, just put this code to your .htaccess


RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111
RewriteCond %{REQUEST_URI} !^/maintenance\.php$
RewriteRule ^(.*)$ http://site.com/maintenance.php [R=307,L]

Change site.com with your site name, and create file called maintenance.php put in your root folder with some announcement on it and now every people who visit your site will redirect to maintenance.php. BUT !! how about you? you as a web designer of the web also will redirect when you want to edit the web. that why we add this line


RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111

Change the 111\.111\.111\.111 to your own IP address (you can check your ip at seeyourip.com) and now you should be able to browse your site and perform your upgrade meanwhile other visitor will redirect to maintenance page.

Enjoy ^^

ps: for WordPress user you can use maintenance mode plugin that you can search on codex.wordpress.org

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment