I want to protect some subdomains from the public. Restriction should be done against a whitelist of IPs. Infinite loop due to the redirect is not a problem as its not the www-domain.
I tried this http://discussions.apple.com/message.jspa?messageID=2411725, but couldnt get it to work.
However I did try this first
RewriteEngine on RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$ [OR] RewriteCond %{REMOTE_ADDR} !^213\.45\.67\.89$ RewriteRule ^/.* http://www.mydomain.com [R]
.. but didnt work.
What am I doing wrong ?
You have to combine the
RewriteConddirectives with AND instead of OR as you want to redirect if both conditions are true (therefor the IP address is neither X nor Y). So try this: