Blocking users by IP


  • strict warning: Non-static method view::load() should not be called statically in /home/swaratec/public_html/modules/views/views.module on line 879.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/swaratec/public_html/modules/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/swaratec/public_html/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/swaratec/public_html/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /home/swaratec/public_html/modules/views/modules/node/views_handler_filter_node_status.inc on line 0.
  • strict warning: Non-static method view::load() should not be called statically in /home/swaratec/public_html/modules/views/views.module on line 879.
  • strict warning: Non-static method view::load() should not be called statically in /home/swaratec/public_html/modules/views/views.module on line 879.
  • strict warning: Non-static method view::load() should not be called statically in /home/swaratec/public_html/modules/views/views.module on line 879.
  • strict warning: Non-static method view::load() should not be called statically in /home/swaratec/public_html/modules/views/views.module on line 879.
  • strict warning: Non-static method view::load() should not be called statically in /home/swaratec/public_html/modules/views/views.module on line 879.

Is there a pesky person perpetrating pain upon you? Stalking your site from the vastness of the electron void? Blockem! In your htaccess file, add the following codechanging the IPs to suit your needseach command on one line each:

order allow,deny  
deny from 123.45.6.7  
deny from 012.34.5.  
allow from all

You can deny access based upon IP address or an IP block. The above blocks access to the site from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.) I have yet to find a useful application of this, maybe if there is a site scraping your content you can block them, who knows.



Back to top