Block IP Addresses And Countries Using .htaccess - Knowledgebase
Block IP Addresses and Countries using .htaccess Support Portal » Knowledgebase » Viewing Article Print
Thank you for your feedback on this article. Share via
- 17-08-2018 10:44
-
- cPanel
-
- Block
- IP Address
- htaccess
| If you’re getting too much unwanted traffic from certain IP’s, a handy tool is the IP blocking feature of .htaccess file (click here for a tutorial on seeing which IP’s hit your site). This file is located in the public_html folder of your primary domain, and the primary folder of any subdomains and add on domains. Just add the following code to the top of your file:order allow,deny deny from 144.5.56.77deny from 12.34.23.107allow from allYou can also do the reverse, and allow only specific IP’s to be allowed on your site:order deny,allowdeny from allallow from 211.35.214.13What if the unwanted visitor is from a different country and keeps changing their IP? Provided your website isn’t intended for visitors from that country, you can easily use the GeoIP tool to block that country. Just add the below code to the top of your .htaccess file.GeoIPEnable On# Add countries you wish to deny hereSetEnvIf GEOIP_COUNTRY_CODE CO DenyCountrySetEnvIf GEOIP_COUNTRY_CODE EG DenyCountrySetEnvIf GEOIP_COUNTRY_CODE HI DenyCountryAllow from allDeny from env=DenyCountryYou can also do the opposite and only allow specific countries to access your website. This is a great proactive security measure if, for example, you only intend to have Australian clients or visitors to your site.GeoIPEnable On# Put countries to allow hereSetEnvIf GEOIP_COUNTRY_CODE AU AllowCountrySetEnvIf GEOIP_COUNTRY_CODE NZ AllowCountryDeny from allAllow from env=AllowCountryA list of all country codes can be found bellow or at their original source here:http://dev.maxmind.com/geoip/legacy/codes/iso3166/ |
Related Articles
-
- 28-03-2018 10:33
How to Block IP Addresses or Countries to your Website Using .htaccess
-
- 22-03-2018 11:29
How to find IP addresses hitting your website and block them in cPanel
-
- 17-08-2018 10:23
Block All Access to your Website Using .htaccess
Từ khóa » Htaccess Block Russian Ip
-
How To Block IP By Country Using .htaccess File - Hostinger
-
How To Block A Country Blocking In WordPress Via .htaccess & Plugin
-
How To Use .htaccess To Block Russian IP Addresses? - Super User
-
Block A Country From Your Site Using Htaccess - InMotion Hosting
-
How To Allow Or Block Visitors From Specific Countries Using .htaccess
-
About Blocking A Country By Using .htaccess - Stack Overflow
-
Block Visitors By Country Using Firewall - IP2Location
-
Block Blog Spammers & Hostile Servers In Russia With Apache Web ...
-
8 Ways To Block Visitors To Your Website By Country
-
Block Russian IP Addresses Usnig Apache .htaccess Deny
-
How To Block IP Address With .htaccess
-
Block All Traffic From Russia To Coming Your Site
-
How To Block A Country In WordPress? (Best Geoblocking Methods)
-
How Can I Deny IP Address By Using .htaccess File - База знаний