Only allow certain IP addresses to access site with mod_rewrite?
问题 We have a directory on our site which we only want to be accessible by a couple of IP addresses. So we have this .htaccess file to try and get it working: RewriteEngine on RewriteCond %(REMOTE_ADDR) !^123\.123\.123\.123 RewriteCond %(REMOTE_ADDR) !^124\.124\.124\.124 RewriteCond %{REMOTE_ADDR} !^125\.125\.125\.125 RewriteCond %{REMOTE_ADDR} !^126\.126\.126\.126 RewriteCond %{REMOTE_ADDR} !^127\.127\.127\.127 RewriteCond %{REMOTE_ADDR} !^128\.128\.128\.128 RewriteCond %{HTTP_REFERER} !^http:/