Portal Home > Knowledgebase > cPanel > Can I Block an Entire Region or Country from Seeing My Site?

Can I Block an Entire Region or Country from Seeing My Site?

You can block visitors from viewing your website by their IP address. In addition, countries have specific IP address ranges which can be completely or partially blocked. There are several ways to restrict visitor access to your site by IP address.

Unfortunately, there is not a method for blocking traffic per IP address in Plesk. If you have Windows hosting, please create a ticket to our Windows department for assistance.

Blocking a Country or Region with .htaccess Deny Rules

Although it is possible to block an entire region or country using this method, it causes huge amounts of overhead for the Apache web server due to the large number of .htaccess rules that are added. This directly affects performance of your website and the server.

Therefore, we discourage use of this technique unless there are compelling reasons to do so. If used, we ask that you limit the number of IPs blocked.

If you have Linux hosting, you can block countries or regions by creating IP deny rules in your .htaccess file. To generate a code to block a country or region:

  1.     Go to
  2.     Under Step 1, select one or more countries that you want to block from the list.
  3.     Under Step 2, select the output format for the rule code.
  4.     Click Download.
  5.     A popup will appear, allowing you to save the code to your local machine or open the generated file to view the code generated.
  6.     Open the document to copy the rule code.

Usually, the .htaccess in your public_html folder is the best location to paste the code as it can protect all of your addon domains and subdomains.
Blocking Specific IPs

If you already know the IP address you want to block, please see the following article for detailed instructions:

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Do you support Joomla!? (Views: 3085)

Powered by WHMCompleteSolution