TurnKey Internet Provides Fully Managed Dedicated and Virtual Private Servers Dedicated Servers | Virtual Servers | Colocation | Managed Services | Support | About

How do I block visitors from my site?

Create a .htaccess file and add the following code--changing the IPs to suit your needs--each 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.)

You can also set an option for deny from all, which would of course deny everyone. You can also allow or deny by domain name rather than IP address (allow from .friendsite.com works, etc.)

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Question

User Opinions (2 votes)

50% thumbs up 50% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Related Questions

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post a comment

To post a comment for this question, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
* Enter the code below:
 

Continue