Nexcess Logo

How to block IPs with .htaccess

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
September 10, 2019

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


  • 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
deny from
deny from
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
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.