![]() |
How to country ban using htaccess?
I need to ban hong kong and china hotlinkers.. since they are no use to me.
so how do i redirect these contries specifically? |
I don't think that's really simple. You need some program that can lookup the IP number in a little database to see which country the visitor is coming from.
Maybe this is something for you: http://nibbi.net/scripts/ip-filter.php |
hing like this?
RewriteEngine On RewriteCond %{REMOTE_HOST} ^.*\.hk$ [OR] RewriteCond %{HTTP:Accept-Language} ^hk.*$ RewriteRule .* http://www.page-to-send-them-to.com/index.htm [R] Deny from .cn |
Redirecting on browser language can be good since I don't think a lot a Chineese people use an English browser.
|
yup only way to ban them is determining location on browser language.. depending on the country you are planning to ban that only 50-90% accuracy (90% chinese for example and 50% if you plan to ban a european country).
Other than that only geo-ip can help you. |
Quote:
actually lookin at my stats, i have their whole ip block. :D |
If you have the IPblock, you can just use a deny statement in the .htaccess. Just put in the first 2 numbers or first 3 of the ip.
<Limit GET POST> order Allow,Deny Deny from XXX.XXX. Allow from all </Limit> That'll drop the traffic completely and won't use the extra resources needed my mod-rewrite to redirect them or check for language or any of that stuff. |
|
| All times are GMT -7. The time now is 04:10 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123