Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a wordpress site that is at a URL and I am wanting to redirect all traffic except a few IP address to a coming soon type page.

So if I had 3 IP's, those 3 IP's would see the current wordpress site and all other traffic would be redirect to a certain URL

Is this possible with Apache? Something that could be put in an .htaccess file?

share|improve this question
up vote 2 down vote accepted

You can do this with mod_rewrite in a .htaccess file:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^123\.255\.123\.255 [OR]
RewriteCond %{REMOTE_ADDR} ^124\.255\.124\.255 [OR]
RewriteCond %{REMOTE_ADDR} ^125\.255\.125\.255
RewriteRule ^(.*)$ http://example.com/ [R=301,L]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.