Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- htaccess: Block IP range, but allow certain user agents within.


brokaddr - 3:49 pm on Dec 21, 2012 (gmt 0)


wow thanks for all the posts guys, this is a lot of complicated info (for me) to try and comprehend!
The IP addresses can be specified using standard RegEx notation, e.g. 200\.50\.(3[2-9]|4[0-7])\. matches 20.50.32.nn to 47.nn and the trailing escaped period is very important.

I know the CIDR range of the block I want to boot, but the IP I want to allow falls in that line.

Please tell me if my interpretation is valid:
RewriteCond %{REMOTE_HOST} ^123\.456\.78\. <--CIDR block (how would I put something like this into the block: 184.72.0.0/15 (amazon IP, for example)
RewriteCond %{REMOTE_HOST} !^123\.333\.333\4\. <-- Full IP of what I want to allow
RewriteCond %{REQUEST_URI} !^/error\.php <-- Error page served to the block that isn't the IP mentioned above
RewriteRule .* - [F]


Thread source:: http://www.webmasterworld.com/apache/4529025.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com