Closing Store for Maintenance
Posted: Tue Jul 07, 2009 7:07 pm
This was discussed over at interspire. I think most people put a closed message on the home page and turn off purchasing. I wasn't happy with that method so this is what I came up with. This will show the page, maintenance.html (customized as you see fit), to all visitors when you enable it in your .htaccess file. You can specify it to allow your IP so you will still be able to access the site to do maintenance. Just don't forget that you've got it in maintenance mode because the site will look normal to you and inaccessible to everyone else.
1. Create a file called maintenance.html and put it in the store root directory. Customize it with your closed for maintenance message.
2. Add the following code to the .htaccess in the store root directory:
3. Replace 123.456.789.10 with your IP. (You can use http://www.whatismyip.com to find out what it is.)
4. When you are not in maintenance mode, comment out all the lines. Uncomment the lines when you want to go into maintenance mode.
Credits: http://www.randomsequence.com/articles/ ... t-your-ip/

1. Create a file called maintenance.html and put it in the store root directory. Customize it with your closed for maintenance message.
2. Add the following code to the .htaccess in the store root directory:
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect everyone who's not from your IP
RewriteCond %{REMOTE_ADDR} !123.456.789.10 [NC]
# Allow real files to be served
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !maintenance.html$ /maintenance.html [R=307,L]
</IfModule>
4. When you are not in maintenance mode, comment out all the lines. Uncomment the lines when you want to go into maintenance mode.
Credits: http://www.randomsequence.com/articles/ ... t-your-ip/