We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.

Your Digital Commerce Experts
Nexcess Logo

How to block IPs with .htaccess

September 10, 2019

How to block IPs specific to various countries from accessing your site.

Attention

  • If you do not have experience in dealing with .htaccess files, we highly recommend that you contact our 24/7 support team for assistance. An improperly handled .htaccess file can cause major problems for your website.
  • Always back up your .htaccess file before making changes to it.

How to block malicious IPs

Within your .htaccess file, either locate the "allow from" list, or create one if necessary. Follow the outline below to add IP addresses:

Order allow,deny
deny from xxx.xxx.xxx.xxx
deny from xxx.xxx.xxx.xxx
deny from xxx.xxx.xxx.xxx
allow from all

These block lists are convenient for blocking countries or areas known for fraudulent orders or traffic-increasing automated bots.   


For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.
Jason Dobry