How to prevent some visitor from some country to view to con

admin

Administrator
Staff member
Hi, I am new in web. I would like to know is there anyway to block or prevent some visitor from certain country to view our website. I know .htaccess can do this. But, when using htaccess. The visitor will get an error "Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.". Is there anyway that if the visitor try to access our website. It will be redirect to some else and they don't even know that our website is online or not. Sorry for my poor english. I hope you all will know what I am trying to say. Thanks for reading and replying my post.You need to get the list of IPs of that particular country.Maybe you could make a custom 403 forbidden page which redirects to google.com?MiniI ban select IPs using apf. But that's me, I'm mean :)Hello,

Well you need to block that IP range either through the server if you have server access or through the control panel of your domain.

Every country has a specific range of IPs and you need to block those IP ranges.

Thank you.

Regards,Hello,That's simple just recompile iptables + ip_geoip and drop what country you need, also they are modules for php and apache.Best RegardsI do it with the help of .htaccess. It works well.We use .htaccess as well and it does the jobUse IP Tables and the will just get a timed out connection and no access to any ports.hiGeoIPEnable OnGeoIPDBFile /path/to/GeoIP.datRewriteEngine onRewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$RewriteRule ^(.*)$ <!-- m --><a class="postlink" href="http://www.canada.com">http://www.canada.com</a><!-- m --> [L]http://www.maxmind.com/app/mod_geoipI posted this IPtable auto-generation utility some time ago...<!-- m --><a class="postlink" href="http://www.webhostingtalk.com/showthread.php?t=342178Very">http://www.webhostingtalk.com/showthrea ... 342178Very</a><!-- m --> nice apollo, I just added some more rules to our firewall :)
 
Top