Do you have a list of countries that you want to block access to your site? Have you tried adding IP numbers into your .htaccess file only to generate a HUGE .htaccess file and a neverending stream of IP numbers? How about using mod_geoip!!
mod_geoip is a module that can be compiled into Apache on build. Generally shared hosting providers will not have this module loaded, however if you are on a VPS or a Dedicated Server you can compile this module into Apache.
Then just do the following
Edit your .htaccess file
GeoIP ON
SetEnvIF GEOIP_COUNTRY_CODE CN BlockThese
SetEnvIF GEOIP_COUNTRY_CODE TR BlockThese
# Add more countries here
Deny from env=BlockThese
A full list of 2 digit country codes can be found here: http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
The above listed in the example are "CN = China" and "TR = Turkey"
You could also just reverse the .htaccess to make it ALLOW and enter US or UK as the country code.
If you don't have mod_geoip installed, you could use the output generated through http://www.countryipblocks.net/country-blocks/select-formats/
Hands-on Web Hosting makes no warranty or representation to how your site will perform if you include blocks on your site. Keep in mind that the larger the .htaccess file, the slower your site loadings will be as it has to process the .htaccess file on each loading. IP numbers can also change and/or be added to certain country ranges. You will need to remember to update this list accordingly.
- Home
-
Store
- Browse All
- MLH-Share
- Shared Hosting
- USA Shared Hosting
- Clustered Hosting
- Cloud Vps Hosting
- Cloud Reseller
- Reseller Hosting USA
- Germany-Reseller
- Uk Reseller Hosting
- Hong Kong Reseller
- Singapore Reseller
- AUSTRALIA RESELLER
- JAPAN RESELLER
- SOUTH AFRICA
- NetherLand
- KVM VPS server
- OpenVZ VPS Server
- VPS-Cloud
- WINDOWS VPS Server
- Windows Remote - Desktop
- USA-Remoted-Desktop
- Uk Cpanel Vps
- Singapore Cpanel Vps
- VPS Reseller
- USA Dedicated Server Plans
- Canada Dedicated Server
- Germany
- Server bidding
- Uk Europe Dedicated Servers
- Singapore Dedicated Servers
- Unmanaged Server
- Special Offer
- Order Dedicated IP
- 1 days trial vps
- Web Design
- WordPress Hosting
- SSL Certificates
- Email Spam Filtering
- HK-VPS Server
- PHP scripts licensed
- hasnatint
- mlh-share-usa
- SSL Certificates
- Website Security
- Website Backup
- VPN
- SEO Tools
- Register a New Domain
- Transfer Domains to Us
- Announcements
- Knowledgebase
- Network Status
- Affiliates
- Contact Us
-
More