Htaccess Block or deny visitors by IP address

Visitor blocking features are available through htaccess available in the Apache web server, and it allows you to approve access or denial to certain visitors and you can simply give access to certain components of the website only. In order to deny visitors by IP address or referrer, simply create .htaccess and follow the instructions given. In most cases you will see a text in the following format.

“Order allow, deny
Deny from
Deny from 123.45.6
Allow from all”

The above illustration simply orders the Apache web server to block a visitor with IP address, therefore each IPs match the first three sets of numbers in’ will be automatically blocked through the htaccess in the Apache web server. You can further add any number to the “deny from…..” and all blocked visitors will receive the message- “403 forbidden”, on their computer screens.

  1. No comments yet!, be the first to post a comment.

Your email will not be published, The required fields marked with '*'