Closing Store for Maintenance

For Articles relating to more than one ISC version
Post Reply
manamana
Confirmed
Confirmed
Posts: 21
Joined: Wed Jun 17, 2009 11:28 pm

Closing Store for Maintenance

Post by manamana »

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:

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>
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/
Last edited by manamana on Mon Sep 07, 2009 7:58 am, edited 1 time in total.
ISC 5.0.5 Multi-Vendor Edition - Already abandoned ship for CS-Cart 2.0 - LOVE IT!
CharlieFoxtrot
Confirmed
Confirmed
Posts: 413
Joined: Sun Aug 09, 2009 1:23 pm

Re: Closing Store for Maintenance

Post by CharlieFoxtrot »

This works perfectly! ~ Thank you!



edit: After a bit of googling, I now understand that the "307" tells the search engines that it's a temporary redirect.
Last edited by CharlieFoxtrot on Sun Aug 09, 2009 9:30 pm, edited 1 time in total.
ISC 4.0.7

"... and let's be honest that whole "by design" thing is getting old too."
CharlieFoxtrot
Confirmed
Confirmed
Posts: 413
Joined: Sun Aug 09, 2009 1:23 pm

Re: Closing Store for Maintenance

Post by CharlieFoxtrot »

I just found another handy use for this... as a redirect AWAY from my development directory.

On a very *rare* occasion, a random customer will wander in to my ISC development directory and browse the version of my store that I'm working on. Harmless enough, I guess... but it is an annoyance for them to discover that they can't check out, or to discover that I'm not actually selling the demo items that come pre-stocked with the ISC installation.

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$ /my-live-store-dir/index.php [R=307,L]
</IfModule>
The only thing I changed appears in red:
RewriteRule !maintenance.html$ /my-live-store-dir/index.php [R=307,L]

This redirects any visitors who don't have my IP address to the actual store location. I didn't change the "!maintenance.html$" because I'm sending the visitor OUT of the development directory anyway.

~ Charlie

PS: Any idea HOW someone might be stumbling into my development directory? Are the search engines finding it? Is ISC announcing itself to search engines?
ISC 4.0.7

"... and let's be honest that whole "by design" thing is getting old too."
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: Closing Store for Maintenance

Post by Martin »

CharlieFoxtrot wrote:PS: Any idea HOW someone might be stumbling into my development directory? Are the search engines finding it? Is ISC announcing itself to search engines?
If you're using something like a googletoolbar, desktop or similar then it's possible that they are tattling on you...
Tony Barnes
Posts: 744
Joined: Thu Jun 18, 2009 8:59 am

Re: Closing Store for Maintenance

Post by Tony Barnes »

Nice trick
Post Reply