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'm trying to use a .htaccess to Redirect people that are not from a certain IP range.
Redirect is working ok, but I can't figure out how to do both at the same time:
- People within a certain range: access to content
- People outside of this range: get redirected somewhere else

Many thanks for your help

share|improve this question

migrated from Oct 19 '10 at 15:15

This question came from our site for computer enthusiasts and power users.

up vote 0 down vote accepted

Have you tried mod_rewrite? For example,

share|improve this answer
looks really great this article. I've never found an article dealing with IP and Rewriting. Many thanks. – Warnaud Oct 21 '10 at 12:37
Works perfectly as I wanted. Many thanks again! – Warnaud Oct 22 '10 at 8:49
Glad it helped. :) – dmah Oct 22 '10 at 14:12

Your Answer


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.