There are two ways you can block someone from visiting your website.
IP Address Blocking
If you know their IP address, you can block them by using the IP Address Blocking tool.
- Log into your eXtend Control Panel
- Scroll down to ‘Web Tools’
- Click ‘IP Address Blocking’
- Enter the IP address you wish to block
- Click ‘Create’
- The IP address will be blocked from visiting your site.
Using .htaccess to block by IP address
If you know their IP address and know where your .htaccess file is, you can also block them by pasting in code into your .htaccess file.
- Back up your .htaccess file
- Open your .htaccess file or create one in a text editor
- At the end of the file, paste this code:
order allow,deny
deny from 111.222.33.444
allow from all
- Upload your new .htaccess file to your server
You can include as many IP addresses as you wish, with each on a new line and with ‘deny from’ preceding the address.
If you want to block a range of IP addresses, leave off the last set of numbers. For example, ‘deny from 111.222.33.’ will block not only 111.222.33.444, but also 111.222.33.1, 111.222.33.500, 111.222.33.22, and all numbers before, after, and in between.
Using .htaccess to block by ISP
If you do not know the IP address, but know the ISP, you can also block them by including the ISP in your .htaccess.
- Back up your .htaccess file
- Open your .htaccess file or create one in a txt editor
- At the end of the file, paste this code:
Order allow,deny
deny from spam-isp.com
alloy from all
- Upload your new .htaccess file to your server