GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PLEASE! Need help with .htacess for Ip Redirection! (https://gfy.com/showthread.php?t=715134)

PostWhore 03-15-2007 10:26 PM

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

PostWhore 03-15-2007 11:30 PM

bumppp

SMOKEY WE NEED YOU!!!

borked 03-15-2007 11:35 PM

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]

PostWhore 03-15-2007 11:45 PM

where do i get maxmind's GeoIP dbase ?

borked 03-15-2007 11:50 PM

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
}

borked 03-15-2007 11:51 PM

Quote:

Originally Posted by PostWhore (Post 12087591)
where do i get maxmind's GeoIP dbase ?

http://www.maxmind.com/app/geoip_country

borked 03-16-2007 12:23 AM

or hit me up if you want a javascript solution without installing anything

raymor 03-16-2007 11:50 AM

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