View Full Version : How to prevent some visitor from some country to view to content?


compferrariman
10-19-2006, 04:34 AM
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.

Mini
10-19-2006, 07:14 AM
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?

Mini

Zealus.com
10-30-2006, 06:40 PM
I ban select IPs using apf. But that's me, I'm mean :)

hostechsupport
10-30-2006, 06:49 PM
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,

voidSecurity
10-30-2006, 10:44 PM
Hello,
That's simple just recompile iptables + ip_geoip and drop what country you need, also they are modules for php and apache.
Best Regards

dannyy
10-31-2006, 03:26 AM
I do it with the help of .htaccess. It works well.

atlwebhosting
10-31-2006, 11:33 AM
We use .htaccess as well and it does the job

markfrompf
11-02-2006, 07:10 PM
Use IP Tables and the will just get a timed out connection and no access to any ports.

voidSecurity
11-02-2006, 07:35 PM
hi
GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.canada.com [L]
http://www.maxmind.com/app/mod_geoip

apollo
11-13-2006, 01:32 AM
I posted this IPtable auto-generation utility some time ago...

http://www.webhostingtalk.com/showthread.php?t=342178

IPGHosting
11-13-2006, 05:21 PM
Very nice apollo, I just added some more rules to our firewall :-)