How to selectively block people from visiting my Web site?

To prevent from any future attacks on your virtual home, it may become necessary to learn how to block certain IP addresses from gaining access to your web site at all. Whether you plan to do this temporarily or for the long term, you’ll be happy to know that doing so is fairly easy. Siliconhouse guide you how to do this within a minutes.

By using .htaccess :

The .htaccess file controls how your site behaves, how secure it is and how well it performs.

The .htaccess file can actually be used in a number of ways, including redirecting visitors, providing customized error responses, and speeding up the response time for your site. But when you want to block people from visiting your spot on the web, you will want to create a file that deals with authentication and authorization.

If you have one site, using .htaccess can be a very efficient way to control who visits it. In order to do this, you will need to locate the IP addresses of those people who left spam comments on your site.

To identify the unwanted visitors:

You can identify the vistor’s IP address from your cPanel of the domain itself.

1) Login to to the cPanel of the domain
2) Then Select Metrics -> Visitors -> Click on the domain name
3) Then You can able to view the visitors IP address, time and all the details.
4) Identify the unwanted visitor from the details.

Steps to follow to block the visitors selectively :

1) Open the .htaccess file of the domain
i) Login to your cpanel
ii) Click File manager
iii) Click on settings -> enable show hidden files option
iv) Then Click on public_html -> .htaccess
v) Right click on .htacess -> Edit

2) At the end of your .htaccess file coding kindly add the below lines:

========

# allow all except those indicated here
<Files *>
order allow,deny
allow from all
deny from xxx.xxx.xxx.xxx
deny from yyy.yyy.yyy.yyy
</Files>

Note that replace xxx.xxx.xxx.xxx and yyy.yyy.yyy.yyy by your unwanted
visitors IP.

By using the above mentioned detailed procedure you can able to block your unwanted visitor who writes bad reviews about your websites and to avoi further hack related issues.

========