![]() |
PLEASE! Need help with .htacess for Ip Redirection!
On monday this week, i realised that there are about 300 Ips from Russia and Ukraine on my site, obviosly my memebers section had a vulnurability..i got strongbox right away and the problem was solved...however i wanna teach those pesky porkers a lesson, and redirect all russian and ukrainian traffic to something nasty, *******, goatse..maybe page full of exploits (anyone know any?)
So here what i need... a code for htacess to redirect russian and ukrainian ips to somewhere else..anyone can help? would apreciate a lot! :thumbsup |
bumppp
SMOKEY WE NEED YOU!!! |
get maxmind's GeoIP dbase and install the apache module (mod_geoip API), then in htaccess:
GeoIPEnable On GeoIPDBFile /path/to/GeoIP.dat RewriteEngine on RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^RU$ ###RUSSIA RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^UA$ ###UKRAINE RewriteRule ^.*$ http://www.gofuckyourself.com/ [L] |
where do i get maxmind's GeoIP dbase ?
|
another way if you want to do fun things in PHP or some other script:
in .htaccess SetEnvIfNoCase GEOIP_COUNTRY_CODE "^RU$" BadBoy=1 SetEnvIfNoCase GEOIP_COUNTRY_CODE "^UA$" BadBoy=1 ##add any other country code to ban then in a php script: if($_SERVER['BadBoy']==1) { //do something with the bad boy ruskies }else{ //we're not banned } |
Quote:
|
or hit me up if you want a javascript solution without installing anything
|
Strongbox already gives you the country, so there's no need for MaxMind.
On about line #73 on login.cgi put something like this: if ($remote_country m/^RU|UA$/) { print "Location: http://www.badhacks.com\n\n"; exit; } Some versions of Strongbox have a list of banned countries included in config.pl already, but the above will work for any version. Remember to save a copy of the default login.cgi any time you modify it, in case you want to go back. |
All times are GMT -7. The time now is 11:30 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123