I want to protect some subdomains from the public. Restriction should be made against the IP whitelist. An endless loop due to redirection is not a problem since it is not a www domain.
I tried this http://discussions.apple.com/message.jspa?messageID=2411725 but couldn't get it working.
However i tried 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 did not work.
What am I doing wrong?
You need to combine the directives RewriteCondwith AND instead of OR, as you want to redirect if both conditions are true (for this, the IP address is neither X nor Y). So try the following:
RewriteCond
RewriteEngine on RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$ RewriteCond %{REMOTE_ADDR} !^213\.45\.67\.89$ RewriteRule ^ http://www.example.com/ [R]
, Apache Allow Deny. <VirtualHost> , , :
Allow
Deny
<VirtualHost>
<Location /> Order allow,deny Allow from all Deny from 123.45.67.89 Deny from 213.45.67.89 </Location>
403 () , www. , ,
www
ErrorDocument 403 http://www.example.com
Source: https://habr.com/ru/post/1703251/More articles:What is the best way to monitor community based websites like stackoverflow, digg etc.? - rssHow to write a GNOME applet with Ruby - ruby | fooobar.comПочему эта функция использует CURL для некоторых URL-адресов, но не для других? - phpWpf hosting window forms - mouse events do not pass - c #How to speed up Google AdSense download time and analytics? - performanceMeaning of “match” in relation to regular expressions - terminologyA simple algebra question for the program I am writing - mathHelp me implement Blackjack in Python (updated) - pythonDuplicate MovieClip in AIR / AS3 - flashIs Objective-C 2.0 exception handling supported on platforms other than Mac OS X? - gccAll Articles