Plesk

Is it possible to block access to website for specific locations through .htaccess file in Plesk?

Question

Is it possible to block access to website for specific locations through .htaccess file in Plesk?

Answer

It only possible to limit access for specific IP addresses added item by item to the .htaccess file, but not to the whole country.

  1. Get list of IP addresses that are needed to be blocked.
  2. Create .htaccess file through Plesk > Domains > example.com > File Manager > New > Create File:

  3. Open the created file and add the following lines:

    order deny,allow
    deny from <IP address from the list>
    deny from <IP address from the list>
    deny from <IP address from the list>
    allow from all

Exit mobile version