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 16 Oct '12, 07:11 xpanta |
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 16 Oct '12, 10:20 bmeyer71 ♦♦ Thank you. django-site-maintenance plugin seems more active and both are very easy to install and configure.
(17 Oct '12, 06:41)
xpanta
|
Hi, You can accomplish this using mod_rewrite via .htaccess. Here are some sample rules you can add:
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 16 Oct '12, 07:40 todork Thank you. Is it possible to not redirect for two or more IPs? Do I also need to configure Nginx?
(17 Oct '12, 06:40)
xpanta
|
I have a questions about the Apache redirect script. If I want to redirect my site to a maintenance page. Would I change the rules to the following example below?
No, it won't. You're using a host name in the REQUEST_URI test, which won't work. If you want to redirect requests for example.com, except those requests that come from xxx.xxx.xxx.xxx, then the rules would be something like:
(25 Nov '14, 20:25)
seanf
Thank you sir for clarifying that. I came from Cpanel which I used for handling redirects. Obviously it makes it much easier, but not as flexible. Edit: I also found a simple script pretty much similar to the ones mentioned. Tested and works! :-)
(26 Nov '14, 01:21)
jcorbind
|