Basically I'm about to start work on a site and I'd like something that I can add into my .htaccess file (or elsewhere) that'll work like this pseudo code: (my ip will be in place of 127.0.0.1)
if (visitors_ip <> 127.0.0.1)
redirectmatch ^(.*)$ http://www.example.com/under-construction.html
Hopefully that makes sense...
That would be something like:
As Andrew points out, the %{REQUEST_URI} condition avoids infinite loop if you redirect to the same domain.
As Xorax comments almost 9 years later:
Be careful with this approach.
I've gotten burned by taking the IP based approach to limiting access, and then losing the lease on my IP address.
Of course you can always ssh into the box in question and change the .htaccess file again, but the 5 minutes of panic while you try to figure out what just happened aren't exactly fun if you aren't expecting it to happen.
I recommend instead using the .htaccess (in conjunction with an htpasswd file) to request credentials for accessing your development site.
A good example of that is here: http://aplawrence.com/foo-web/htaccess-authentication.html
Here's the solution I ended up using, note that it is similar to VonC's except that his caused an infinite loop if you chose to redirect to the same domain.
It should also be noted that 302 is a temporary move and should be used instead of nothing or 301.
before your wordpress ifmodule this will redirect everyone except the 3 ip address in question.
You simply ftp to the site and edit the .htaccess file if your IP address changes.