login community faq

hi,

I want to shut down my site (in django on Apache) for a day to upload many changes (and do some more testing). What I would like to do is to redirect all incoming traffic to a static page (that says that we will be back shortly), but the requests from my (and my collegues) IP address should work normally.

Is that possible? How?

asked Oct 16 '12 at 07:11

xpanta's gravatar image

xpanta
6014


Another option you might want to take a look at is django-maintenancemode. That will allow you to put up a static page to let your visitors know the site is down for maintenance but still allow you to work on the site.

There is this one as well django-site-maintenance

answered Oct 16 '12 at 10:20

bmeyer71's gravatar image

bmeyer71 ♦♦
8512310

edited Oct 16 '12 at 10:45

Thank you. django-site-maintenance plugin seems more active and both are very easy to install and configure.

(Oct 17 '12 at 06:41) xpanta xpanta's gravatar image

Hi,

You can accomplish this using mod_rewrite via .htaccess. Here are some sample rules you can add:

1
2
3
4
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^xxx\.xxx\.xxx\.xxx
RewriteCond %{REQUEST_URI} !/staticpage\.html$
RewriteRule (.*) /staticpage.html [R=302,L]

This would redirect all users that don't have the IP xxx.xxx.xxx.xxx to the "/staticpage.html" URL.

I hope this helps.

answered Oct 16 '12 at 07:40

todork's gravatar image

todork
10964

Thank you. Is it possible to not redirect for two or more IPs? Do I also need to configure Nginx?

(Oct 17 '12 at 06:40) xpanta xpanta's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×641
×149

Asked: Oct 16 '12 at 07:11

Seen: 442 times

Last updated: Oct 17 '12 at 06:41

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited